﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>BlogJava-gembin-随笔分类-XML</title><link>http://www.blogjava.net/gembin/category/31131.html</link><description>&lt;font color="red"&gt;OSGi, Eclipse Equinox, ECF, Virgo, Gemini,  Apache Felix, Karaf, Aires, Camel, Eclipse RCP&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;
&lt;font color="green"&gt;HBase, Hadoop, ZooKeeper, Cassandra&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;

&lt;font color="blue"&gt;Flex4, AS3, Swiz framework, GraniteDS, BlazeDS etc.&lt;/font&gt;&lt;br/&gt;&lt;br/&gt;
&lt;font color="black"&gt;
There is nothing that software can't fix. Unfortunately, there is also nothing that software can't completely fuck up. That gap is called talent.&lt;/font&gt;
&lt;br/&gt;&lt;br/&gt;

&lt;a href="http://about.me/gembin"&gt;About Me&lt;/a&gt;

&lt;script type="text/javascript" src="http://platform.linkedin.com/in.js"&gt;&lt;/script&gt;&lt;script type="in/share" data-counter="right"&gt;&lt;/script&gt;

</description><language>zh-cn</language><lastBuildDate>Sun, 26 Aug 2012 01:31:17 GMT</lastBuildDate><pubDate>Sun, 26 Aug 2012 01:31:17 GMT</pubDate><ttl>60</ttl><item><title>XML Naming Conventions</title><link>http://www.blogjava.net/gembin/archive/2012/08/25/386269.html</link><dc:creator>gembin</dc:creator><author>gembin</author><pubDate>Sat, 25 Aug 2012 08:43:00 GMT</pubDate><guid>http://www.blogjava.net/gembin/archive/2012/08/25/386269.html</guid><wfw:comment>http://www.blogjava.net/gembin/comments/386269.html</wfw:comment><comments>http://www.blogjava.net/gembin/archive/2012/08/25/386269.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/gembin/comments/commentRss/386269.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/gembin/services/trackbacks/386269.html</trackback:ping><description><![CDATA[Names&nbsp;can&nbsp;start&nbsp;with&nbsp;letters&nbsp;including&nbsp;non-Latin&nbsp;characters.<br style="font-family: monospace; font-size: medium; line-height: normal; white-space: nowrap; background-color: #ffffff; " />Names&nbsp;can&nbsp;start&nbsp;with&nbsp;dash&nbsp;(-)&nbsp;character.<br style="font-family: monospace; font-size: medium; line-height: normal; white-space: nowrap; background-color: #ffffff; " />Names&nbsp;cannot&nbsp;start&nbsp;with&nbsp;numbers&nbsp;or&nbsp;other&nbsp;punctuation&nbsp;characters.&nbsp;<br style="font-family: monospace; font-size: medium; line-height: normal; white-space: nowrap; background-color: #ffffff; " />After&nbsp;the&nbsp;first&nbsp;character,&nbsp;numbers,&nbsp;hyphens,&nbsp;and&nbsp;periods&nbsp;are&nbsp;allowed.&nbsp;<br style="font-family: monospace; font-size: medium; line-height: normal; white-space: nowrap; background-color: #ffffff; " />Names&nbsp;can't&nbsp;contain&nbsp;spaces.&nbsp;<br style="font-family: monospace; font-size: medium; line-height: normal; white-space: nowrap; background-color: #ffffff; " />Names&nbsp;can't&nbsp;contain&nbsp;the&nbsp;colon&nbsp;(:)&nbsp;character.&nbsp;<br style="font-family: monospace; font-size: medium; line-height: normal; white-space: nowrap; background-color: #ffffff; " />Names&nbsp;can't&nbsp;start&nbsp;with&nbsp;the&nbsp;letters&nbsp;xml,&nbsp;in&nbsp;uppercase,&nbsp;lowercase,&nbsp;or&nbsp;mixed.<br style="font-family: monospace; font-size: medium; line-height: normal; white-space: nowrap; background-color: #ffffff; " />There&nbsp;can't&nbsp;be&nbsp;a&nbsp;space&nbsp;after&nbsp;the&nbsp;opening&nbsp;&lt;<br style="font-family: monospace; font-size: medium; line-height: normal; white-space: nowrap; background-color: #ffffff; " />There&nbsp;can&nbsp;be&nbsp;space&nbsp;before&nbsp;the&nbsp;closing&nbsp;&gt;&nbsp;character.&nbsp;<br style="font-family: monospace; font-size: medium; line-height: normal; white-space: nowrap; background-color: #ffffff; " /><br style="font-family: monospace; font-size: medium; line-height: normal; white-space: nowrap; background-color: #ffffff; " />Here&nbsp;are&nbsp;some&nbsp;examples&nbsp;of&nbsp;valid&nbsp;names:&nbsp;&lt;first.name&gt;&nbsp;<br style="font-family: monospace; font-size: medium; line-height: normal; white-space: nowrap; background-color: #ffffff; " /><br style="font-family: monospace; font-size: medium; line-height: normal; white-space: nowrap; background-color: #ffffff; " />Following&nbsp;are&nbsp;some&nbsp;examples&nbsp;of&nbsp;invalid&nbsp;names:&nbsp;<br style="font-family: monospace; font-size: medium; line-height: normal; white-space: nowrap; background-color: #ffffff; " /><br style="font-family: monospace; font-size: medium; line-height: normal; white-space: nowrap; background-color: #ffffff; " />&lt;xml-element&gt;&nbsp;which&nbsp;starts&nbsp;with&nbsp;xml,&nbsp;<br style="font-family: monospace; font-size: medium; line-height: normal; white-space: nowrap; background-color: #ffffff; " /><br style="font-family: monospace; font-size: medium; line-height: normal; white-space: nowrap; background-color: #ffffff; " />&lt;123&gt;&nbsp;which&nbsp;starts&nbsp;with&nbsp;a&nbsp;number,&nbsp;<br style="font-family: monospace; font-size: medium; line-height: normal; white-space: nowrap; background-color: #ffffff; " /><br style="font-family: monospace; font-size: medium; line-height: normal; white-space: nowrap; background-color: #ffffff; " />&lt;your=xml&gt;&nbsp;because&nbsp;the&nbsp;equals&nbsp;sign&nbsp;(=)sign&nbsp;is&nbsp;illegal,&nbsp;and&nbsp;<br style="font-family: monospace; font-size: medium; line-height: normal; white-space: nowrap; background-color: #ffffff; " /><br style="font-family: monospace; font-size: medium; line-height: normal; white-space: nowrap; background-color: #ffffff; " />&lt;your&nbsp;element&gt;&nbsp;which&nbsp;contains&nbsp;a&nbsp;space.<br /><font color="#000000" style="font-family: monospace; font-size: medium; line-height: normal; white-space: nowrap; background-color: #ffffff; "><br /><br /></font><table width="800" border="0" style="font-family: Arial; "><tbody><tr><td class="codeTitle" style="font-size: 24px; border-bottom-color: #cccccc; border-bottom-style: solid; ">Case Sensitivity</td></tr><tr><td><table border="0"><tbody><tr><td height="20"></td></tr></tbody></table><span style="font-family: Arial, 'Liberation Sans', 'DejaVu Sans', sans-serif; font-size: 14px; line-height: 18px; background-color: #ffffff; ">Most XML standards originating from the W3C tend to use lower case with hyphens.</span></td></tr><tr><td><table border="0" cellpadding="3" cellspacing="0" bgcolor="#ffffff"><tbody><tr><td nowrap="nowrap" valign="top" align="left"><div class="codeShade" style="padding: 4px; margin-left: 0em; border: 1px solid #cccccc; margin-top: 0.5em; margin-bottom: 0.5em; "><code><font color="#000000">&lt;first&gt;&nbsp;is&nbsp;different&nbsp;</font><font color="#7f0055"><strong>from&nbsp;</strong></font><font color="#000000">&lt;FIRST&gt;,&nbsp;which&nbsp;is&nbsp;different&nbsp;</font><font color="#7f0055"><strong>from&nbsp;</strong></font><font color="#000000">&lt;First&gt;.&nbsp;</font><br /><font color="#ffffff"></font><br /><font color="#000000">It</font><font color="#ff6100">'s&nbsp;</font><font color="#000000">a&nbsp;good&nbsp;idea&nbsp;to&nbsp;pick&nbsp;a&nbsp;naming&nbsp;style&nbsp;and&nbsp;stick&nbsp;to&nbsp;it.&nbsp;</font><br /><font color="#000000">Some&nbsp;examples&nbsp;of&nbsp;common&nbsp;styles&nbsp;are&nbsp;as&nbsp;follows:&nbsp;</font><br /><font color="#ffffff"></font><br /><font color="#000000">&lt;first_name&gt;&nbsp;</font><br /><font color="#000000">&lt;firstName&gt;&nbsp;</font><br /><font color="#000000">&lt;first-name&gt;&nbsp;</font><br /><font color="#000000">&lt;FirstName&gt;</font></code></div></td></tr></tbody></table></td></tr></tbody></table><font color="#000000" style="font-family: monospace; font-size: medium; line-height: normal; white-space: nowrap; background-color: #ffffff; "><br /></font><img src ="http://www.blogjava.net/gembin/aggbug/386269.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/gembin/" target="_blank">gembin</a> 2012-08-25 16:43 <a href="http://www.blogjava.net/gembin/archive/2012/08/25/386269.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>SAX vs. DOM</title><link>http://www.blogjava.net/gembin/archive/2012/04/01/373206.html</link><dc:creator>gembin</dc:creator><author>gembin</author><pubDate>Sun, 01 Apr 2012 08:32:00 GMT</pubDate><guid>http://www.blogjava.net/gembin/archive/2012/04/01/373206.html</guid><wfw:comment>http://www.blogjava.net/gembin/comments/373206.html</wfw:comment><comments>http://www.blogjava.net/gembin/archive/2012/04/01/373206.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/gembin/comments/commentRss/373206.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/gembin/services/trackbacks/373206.html</trackback:ping><description><![CDATA[<div style="color: #151b66; font-size: 13px; line-height: 16px; text-align: left; background-color: #ffffff; font-family: 'Trebuchet MS', sans-serif; ">While comparing two entities, we tend to see both of them as competitors and consequently comparing them to find a winner. This of course is not applicable in every case - not at least in the case of SAX and DOM. Both have their own pros and cons and they are certainly not in direct competition with each other.</div><div style="color: #151b66; font-size: 13px; line-height: 16px; text-align: left; background-color: #ffffff; font-family: 'Trebuchet MS', sans-serif; "></div><div style="font-size: 13px; line-height: 16px; text-align: left; background-color: #ffffff; font-family: 'Trebuchet MS', sans-serif; "><br style="clear: both; " /><strong>SAX vs. DOM</strong></div><div style="color: #151b66; font-size: 13px; line-height: 16px; text-align: left; background-color: #ffffff; font-family: 'Trebuchet MS', sans-serif; "></div><div style="color: #151b66; font-size: 13px; line-height: 16px; text-align: left; background-color: #ffffff; font-family: 'Trebuchet MS', sans-serif; "><br style="clear: both; " />Main differences between SAX and DOM, which are the two most popular APIs for processing XML documents in Java, are:-</div><ul style="color: #151b66; font-size: 13px; line-height: 16px; text-align: left; background-color: #ffffff; font-family: 'Trebuchet MS', sans-serif; "><li><strong style="color: black; ">Read v/s Read/Write:</strong>&nbsp;SAX can be used only for reading XML documents and not for the manipulation of the underlying XML data whereas DOM can be used for both read and write of the data in an XML document.</li><li><strong style="color: black; ">Sequential Access v/s Random Access:</strong>&nbsp;SAX can be used only for a sequential processing of an XML document whereas DOM can be used for a random processing of XML docs. So what to do if you want a random access to the underlying XML data while using SAX? You got to store and manage that information so that you can retrieve it when you need.</li><li><strong style="color: black; ">Call back v/s Tree:</strong>&nbsp;SAX uses call back mechanism and uses event-streams to read chunks of XML data into the memory in a sequential manner whereas DOM uses a tree representation of the underlying XML document and facilitates random access/manipulation of the underlying XML data.</li><li><strong style="color: black; ">XML-Dev mailing list v/s W3C:</strong>&nbsp;SAX was developed by the XML-Dev mailing list whereas DOM was developed by W3C (World Wide Web Consortium).</li><li><strong style="color: black; ">Information Set:</strong>&nbsp;SAX doesn't retain all the info of the underlying XML document such as comments whereas DOM retains almost all the info. New versions of SAX are trying to extend their coverage of information.</li></ul><div style="color: #151b66; font-size: 13px; line-height: 16px; text-align: left; background-color: #ffffff; font-family: 'Trebuchet MS', sans-serif; "><strong style="color: black; ">Usual Misconceptions</strong></div><ul style="color: #151b66; font-size: 13px; line-height: 16px; text-align: left; background-color: #ffffff; font-family: 'Trebuchet MS', sans-serif; "><li><strong style="color: black; ">SAX is always faster:</strong>&nbsp;this is a very common misunderstanding and one should be aware that SAX may not always be faster because it might not enjoy the storage-size advantage in every case due to the cost of call backs depending upon the particular situation, SAX is being used in.</li><li><strong style="color: black; ">DOM always keeps the whole XML doc in memory:</strong>&nbsp;it's not always true. DOM implementations not only vary in their code size and performance, but also in their memory requirements and few of them don't keep the entire XML doc in memory all the time. Otherwise, processing/manipulation of very large XML docs may virtually become impossible using DOM, which is of course not the case.</li></ul><div style="color: #151b66; font-size: 13px; line-height: 16px; text-align: left; background-color: #ffffff; font-family: 'Trebuchet MS', sans-serif; "><br style="clear: both; " /><div style="color: black; "><strong>How to choose one between the two?</strong></div><br style="clear: both; " />It primarily depends upon the requirement. If the underlying XML data requires manipulation then almost always DOM will be used as SAX doesn't allow that. Similarly if the nature of access is random (for example, if you need contextual info at every stage) then DOM will be the way to go in most of the cases. But, if the XML document is only required to be read and that too sequentially, then SAX will probably be a better alternative in most of the cases. SAX was developed mainly for pasring XML documents and it's certainly good at it. SO, if you need to process an XML document maybe to update a datasource, SAX will probably make a alternative.</div><div style="color: #151b66; font-size: 13px; line-height: 16px; text-align: left; background-color: #ffffff; font-family: 'Trebuchet MS', sans-serif; "></div><div style="color: #151b66; font-size: 13px; line-height: 16px; text-align: left; background-color: #ffffff; font-family: 'Trebuchet MS', sans-serif; ">Requirements may certainly fall between the two extremes discussed above and for any such situation you should weight both the alternatives before picking any of the two. There are applications where a combination of both SAX and DOM are used for XML processing so that might also be an alternative in your case. But, basically it would be a design decision and evidently it would require a thorough analysis of the pros and cons of all possible approaches in that situation.</div><img src ="http://www.blogjava.net/gembin/aggbug/373206.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/gembin/" target="_blank">gembin</a> 2012-04-01 16:32 <a href="http://www.blogjava.net/gembin/archive/2012/04/01/373206.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Eclipse Plugin for eXist (COOL)</title><link>http://www.blogjava.net/gembin/archive/2008/09/11/228346.html</link><dc:creator>gembin</dc:creator><author>gembin</author><pubDate>Thu, 11 Sep 2008 05:44:00 GMT</pubDate><guid>http://www.blogjava.net/gembin/archive/2008/09/11/228346.html</guid><wfw:comment>http://www.blogjava.net/gembin/comments/228346.html</wfw:comment><comments>http://www.blogjava.net/gembin/archive/2008/09/11/228346.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/gembin/comments/commentRss/228346.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/gembin/services/trackbacks/228346.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: Eclipse Plugin eXist&nbsp;&nbsp;<a href='http://www.blogjava.net/gembin/archive/2008/09/11/228346.html'>阅读全文</a><img src ="http://www.blogjava.net/gembin/aggbug/228346.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/gembin/" target="_blank">gembin</a> 2008-09-11 13:44 <a href="http://www.blogjava.net/gembin/archive/2008/09/11/228346.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Why And How To Use PDOM: A Persistent W3C DOM API</title><link>http://www.blogjava.net/gembin/archive/2008/07/29/218491.html</link><dc:creator>gembin</dc:creator><author>gembin</author><pubDate>Tue, 29 Jul 2008 09:18:00 GMT</pubDate><guid>http://www.blogjava.net/gembin/archive/2008/07/29/218491.html</guid><wfw:comment>http://www.blogjava.net/gembin/comments/218491.html</wfw:comment><comments>http://www.blogjava.net/gembin/archive/2008/07/29/218491.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/gembin/comments/commentRss/218491.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/gembin/services/trackbacks/218491.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: PDOM stands for Persistent Document Object Model.&nbsp;&nbsp;<a href='http://www.blogjava.net/gembin/archive/2008/07/29/218491.html'>阅读全文</a><img src ="http://www.blogjava.net/gembin/aggbug/218491.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/gembin/" target="_blank">gembin</a> 2008-07-29 17:18 <a href="http://www.blogjava.net/gembin/archive/2008/07/29/218491.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>XQuery Search and Update</title><link>http://www.blogjava.net/gembin/archive/2008/07/29/218487.html</link><dc:creator>gembin</dc:creator><author>gembin</author><pubDate>Tue, 29 Jul 2008 09:15:00 GMT</pubDate><guid>http://www.blogjava.net/gembin/archive/2008/07/29/218487.html</guid><wfw:comment>http://www.blogjava.net/gembin/comments/218487.html</wfw:comment><comments>http://www.blogjava.net/gembin/archive/2008/07/29/218487.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/gembin/comments/commentRss/218487.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/gembin/services/trackbacks/218487.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: The XQuery 1.0 specification describes a powerful language for accessing and manipulating XML. In its initial form XQuery lacks two interesting features: fast token-based text search and node-level update. Specifications for these features are under development at the W3C with release dates after XQuery 1.0. This paper looks at the mechanisms by which XQuery can support search and update based on our experience at Mark Logic implementing these features.&nbsp;&nbsp;<a href='http://www.blogjava.net/gembin/archive/2008/07/29/218487.html'>阅读全文</a><img src ="http://www.blogjava.net/gembin/aggbug/218487.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/gembin/" target="_blank">gembin</a> 2008-07-29 17:15 <a href="http://www.blogjava.net/gembin/archive/2008/07/29/218487.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>Native XML Databases</title><link>http://www.blogjava.net/gembin/archive/2008/07/29/218381.html</link><dc:creator>gembin</dc:creator><author>gembin</author><pubDate>Tue, 29 Jul 2008 05:50:00 GMT</pubDate><guid>http://www.blogjava.net/gembin/archive/2008/07/29/218381.html</guid><wfw:comment>http://www.blogjava.net/gembin/comments/218381.html</wfw:comment><comments>http://www.blogjava.net/gembin/archive/2008/07/29/218381.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/gembin/comments/commentRss/218381.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/gembin/services/trackbacks/218381.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: Defines a (logical) model for an XML document -- as opposed to the data in that document -- and stores and retrieves documents according to that model. At a minimum, the model must include elements, attributes, PCDATA, and document order. Examples of such models are the XPath data model, the XML Infoset, and the models implied by the DOM and the events in SAX 1.0.&nbsp;&nbsp;<a href='http://www.blogjava.net/gembin/archive/2008/07/29/218381.html'>阅读全文</a><img src ="http://www.blogjava.net/gembin/aggbug/218381.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/gembin/" target="_blank">gembin</a> 2008-07-29 13:50 <a href="http://www.blogjava.net/gembin/archive/2008/07/29/218381.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>SoftwareAG的Tamino Server</title><link>http://www.blogjava.net/gembin/archive/2008/07/29/218370.html</link><dc:creator>gembin</dc:creator><author>gembin</author><pubDate>Tue, 29 Jul 2008 05:37:00 GMT</pubDate><guid>http://www.blogjava.net/gembin/archive/2008/07/29/218370.html</guid><wfw:comment>http://www.blogjava.net/gembin/comments/218370.html</wfw:comment><comments>http://www.blogjava.net/gembin/archive/2008/07/29/218370.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.blogjava.net/gembin/comments/commentRss/218370.html</wfw:commentRss><trackback:ping>http://www.blogjava.net/gembin/services/trackbacks/218370.html</trackback:ping><description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp; 摘要: Software AG是德国的一家多年从事系统软件、ERP、电子商务产品和应用解决方案的软件厂商。&nbsp;&nbsp;<a href='http://www.blogjava.net/gembin/archive/2008/07/29/218370.html'>阅读全文</a><img src ="http://www.blogjava.net/gembin/aggbug/218370.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.blogjava.net/gembin/" target="_blank">gembin</a> 2008-07-29 13:37 <a href="http://www.blogjava.net/gembin/archive/2008/07/29/218370.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>