XML 使用XSLT输出未格式化的XML

<xsl:output method='xml' version="1.0" indent='yes'/>
<xsl:template match="/">
    <xsl:copy-of select="."/>
</xsl:template>

XML Log4Net web.config

<log4net>
    <logger name="logger">
      <!--Loggers may be assigned levels. Levels are instances of the log4net.Core.Level  class. The following levels are defined in order of increasing priority:

      * ALL
      * DEBUG
      * INFO
      * WARN
      * ERROR
      * FATAL
      * OFF-->

      <level value="ERROR"/>
      <appender-ref ref="RollingLogFileAppender" />
      <appender-ref ref="TraceAppender" />
    </logger>

    <appender name="TraceAppender" type="log4net.Appender.TraceAppender">
      <layout type="log4net.Layout.PatternLayout">
        <conversionPattern value="%date [%thread] %-5level %logger [%property{NDC}] - %message%newline" />
      </layout>
    </appender>

    <appender name="RollingLogFileAppender" type="log4net.Appender.RollingFileAppender,log4net">
      <param name="File" value="diagnostics.log" />
      <param name="AppendToFile" value="true" />
      <param name="MaxSizeRollBackups" value="10" />
      <param name="MaximumFileSize" value="5MB" />
      <param name="RollingStyle" value="Size" />
      <param name="StaticLogFileName" value="true" />

      <layout type="log4net.Layout.PatternLayout,log4net">
        <header value="******************************************************
********************* START **************************
******************************************************
" />
        <footer value="*********************** END **************************

" />
        <param name="ConversionPattern" value="%d [%t] %-5p %c [%x] - %m%n" />
      </layout>
    </appender>
  </log4net>

XML API文章XML输出

<?xml version="1.0"?>
<recipes>
	<recipe> 
		<recipe_id>20</recipe_id> 
		<recipe_name>Grilled Flounder</recipe_name> 
		<recipe_poster>Billy Bob</recipe_poster> 
		<recipe_quick_info>20 minutes prep, 40 minutes total time</recipe_quick_info> 
		<recipe_link>http://www.example.com/</recipe_link> 
	</recipe> 
	
	<recipe> 
		<recipe_id>19</recipe_id> 
		<recipe_name>Grilled Flounder</recipe_name> 
		<recipe_poster>Billy Bob</recipe_poster> 
		<recipe_quick_info>20 minutes prep, 40 minutes total time</recipe_quick_info> 
		<recipe_link>http://www.example.com/</recipe_link> 
	</recipe>
	 
	<recipe> 
		<recipe_id>18</recipe_id> 
		<recipe_name>Grilled Flounder</recipe_name> 
		<recipe_poster>Billy Bob</recipe_poster> 
		<recipe_quick_info>20 minutes prep, 40 minutes total time</recipe_quick_info> 
		<recipe_link>http://www.example.com/</recipe_link> 
	</recipe> 
	
	<recipe> 
		<recipe_id>17</recipe_id> 
		<recipe_name>Grilled Flounder</recipe_name> 
		<recipe_poster>Billy Bob</recipe_poster> 
		<recipe_quick_info>20 minutes prep, 40 minutes total time</recipe_quick_info> 
		<recipe_link>http://www.example.com/</recipe_link> 
	</recipe> 
	
	<recipe> 
		<recipe_id>16</recipe_id> 
		<recipe_name>Grilled Flounder</recipe_name> 
		<recipe_poster>Billy Bob</recipe_poster> 
		<recipe_quick_info>20 minutes prep, 40 minutes total time</recipe_quick_info> 
		<recipe_link>http://www.example.com/</recipe_link> 
	</recipe> 
</recipes>

XML HTTPS Tomcat配置

<Connector port="8443" minSpareThreads="5" maxSpareThreads="75"
           enableLookups="true" disableUploadTimeout="true" 
           acceptCount="100"  maxThreads="200"
           scheme="https" secure="true" SSLEnabled="true"
		   keystoreType="PKCS12" keystoreFile="C:/keystore.p12" keystorePass="password"
		   truststoreType="PKCS12" truststoreFile="C:/keystore.p12" truststorePass="password"
           clientAuth="true" sslProtocol="TLS"/>

XML EE RSS模板改进

{assign_variable:master_weblog_name="BLOG"}
{assign_variable:master_weblog_status="OPEN"}
{assign_variable:master_rss_uri="http://PATH/TO/THIS/RSS/FEED"}

{exp:rss:feed weblog="{master_weblog_name}" status="{master_weblog_status}"}
<?xml version="1.0" encoding="{encoding}"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
    xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
    <title>{exp:xml_encode}{weblog_name}{/exp:xml_encode}</title>
    <link>{weblog_url}</link>
    <description>{weblog_description}</description>
    <dc:language>{weblog_language}</dc:language>
    <dc:creator>{email}</dc:creator>
    <dc:rights>Copyright {gmt_date format="%Y"}</dc:rights>
    <pubDate>{gmt_date format="%D, %d %M %Y %H:%i:%s %T"}</pubDate>
    <atom:link href="{master_rss_uri}" rel="self" type="application/rss+xml" />   
{exp:weblog:entries weblog="{master_weblog_name}" limit="10" rdf="off" dynamic_start="on" disable="member_data|trackbacks" status="{master_weblog_status}"}
    <item>
      <title>{exp:xml_encode protect_entities="yes"}{title}{/exp:xml_encode}</title>
      <link>{title_permalink=site/index}</link>
      <guid isPermaLink="false">{title_permalink="site/index"}#id:{entry_id}#date:{gmt_entry_date format="%H:%i"}</guid>
      <description><![CDATA[{summary}{body}]]></description>
      {categories}<category>{exp:xml_encode protect_entities="yes"}{category_name}{/exp:xml_encode}</category>
      {/categories}
      <pubDate>{gmt_entry_date format="%D, %d %M %Y %H:%i %T"}</pubDate>
    </item>
{/exp:weblog:entries}
    </channel>
</rss>
{/exp:rss:feed}

XML ГÐμнÐμраÑ,орÐ'ÐμмоÑ,иваÑ,оровнаsh

#!/bin/sh
    TEMPLATE='<?xml version="1.0" standalone="no"?>
    <!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN"
      "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
    <svg width="800" height="640" version="1.1"
         xmlns="http://www.w3.org/2000/svg"
         xmlns:xlink="http://www.w3.org/1999/xlink">
      <rect width="800" height="640"
            style="fill:rgb(0,0,0);"/>
      <rect x="75" y="50" width="650" height="440"
            style="stroke:rgb(255,255,255);stroke-width:1;"/>
      <image x="77" y="52" width="646px" height="436px"
             xlink:href="%s"/>
      <text text-anchor="middle" x="50%%" y="545"
            font-family="Times New Roman" font-size="55"
            style="fill:rgb(255,255,255);">
        %s
      </text>
      <text text-anchor="middle" x="50%%" y="580"
            font-family="Verdana" font-size="20"
            style="fill:rgb(255,255,255);">
        %s
      </text>
    </svg>';
    printf "$TEMPLATE" "$1" "$2" "$3" | convert -quality 85 - "$4"

XML Wordpress RSS XML空间错误

// find these lines in the php file (ie, feed-rss2.php)
header('Content-Type: text/xml; charset=' . get_option('blog_charset'), true);
$more = 1;

// immediately add these 3 lines after
$out = ob_get_contents();
$out = str_replace(array("\n", "\r", "\t", " "), "", $input);
ob_end_clean();

XML 推特饲料

<entry>
    <id>tag:search.twitter.com,2005:5471892242</id>
    <published>2009-11-06T05:44:39Z</published>
    <link type="text/html" href="http://twitter.com/pranavprakash/statuses/5471892242" rel="alternate"/>
    <title>#friday morning :-) feels good at work</title>
    <content type="html"><a href="http://search.twitter.com/search?q=%23friday"><b>#friday</b></a> morning :-) feels good at work</content>
    <updated>2009-11-06T05:44:39Z</updated>
    <link type="image/png" href="http://a1.twimg.com/profile_images/440746892/6a00c225236005f21900e398c442620001-320pi_normal.jpg" rel="image"/>
    <twitter:geo>
    </twitter:geo>
    <twitter:source><a href="http://echofon.com/" rel="nofollow">Echofon</a></twitter:source>
    <twitter:lang>en</twitter:lang>
    <author>
      <name>pranavprakash (Pranav Prakash)</name>
      <uri>http://twitter.com/pranavprakash</uri>
    </author>
  </entry>

XML 我的GIT / CONFIG

~ git/config
 
[core]
	repositoryformatversion = 0
	filemode = true
	bare = false
	logallrefupdates = true
	ignorecase = true
[remote "origin"]
	url = git@github.com:flunder/Snuff.git
	fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
        remote = origin
        merge = refs/heads/master
 
~ also do "git config --global push.default matching" to remove the "warning: You 
did not specify any refspecs to push..." warning. Phew, much cleaner already!

XML WPF DataBinding

<StackPanel>
        <StackPanel.Resources>
            <XmlDataProvider x:Key="MoreColors" XPath="/colors">
                <x:XData>
                    <colors >
                        <color name="pink"/>
                        <color name="white"/>
                        <color name="black"/>
                        <color name="cyan"/>
                        <color name="gray"/>
                        <color name="magenta"/>
                    </colors>
                </x:XData>
            </XmlDataProvider>

        </StackPanel.Resources>
        <ListBox x:Name="lbColor" Width="248" Height="56" 
    IsSynchronizedWithCurrentItem="True" 
    ItemsSource="{Binding Source={StaticResource MoreColors}, 
    XPath=color/@name}">
        </ListBox>
    </StackPanel>