<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
    <title>Colas.Nahaboo.net - xml</title>
    <subtitle>Colas Nahaboo personal site, with discussions about programming code, web and computing topics, surfing and SUPing, and various musings.</subtitle>
    <link rel="self" type="application/atom+xml" href="https://colas.nahaboo.net/tags/xml/atom.xml"/>
    <link rel="alternate" type="text/html" href="https://colas.nahaboo.net"/>
    <generator uri="https://www.getzola.org/">Zola</generator>
    <updated>2026-08-30T00:00:00+00:00</updated>
    <id>https://colas.nahaboo.net/tags/xml/atom.xml</id>
    <entry xml:lang="en">
        <title>KXF: The Koala XML Form</title>
        <published>2026-08-30T00:00:00+00:00</published>
        <updated>2026-08-30T00:00:00+00:00</updated>
        
        <author>
          <name>Unknown</name>
        </author>
        
        <link rel="alternate" type="text/html" href="https://colas.nahaboo.net/blog/kxf-the-koala-xml-form/"/>
        <id>https://colas.nahaboo.net/blog/kxf-the-koala-xml-form/</id>
        
        <content type="html" xml:base="https://colas.nahaboo.net/blog/kxf-the-koala-xml-form/">&lt;div class=&quot;obsolete-overlay&quot;&gt;
    Legacy
&lt;/div&gt;
&lt;style&gt;
.obsolete-overlay {
    position: fixed;
    top: 40px;
    left: 60%;
    transform: translate(-50%, -50%) rotate(-5deg);
    font-size: 2vw;
    font-weight: 800;
    color: rgba(255, 0, 0, 0.4);
    background: rgba(255, 255, 0, 0.2);
    border: 15px solid rgba(255, 0, 0, 0.3);
    padding: 10px 20px;
    z-index: 9999;
    pointer-events: none;
    text-transform: uppercase;
    white-space: nowrap;
    user-select: none;
}
&lt;/style&gt;
&lt;p&gt;A blast from the past... In the last century, when we wrote XML by hand, I designed a format to get rid of one of XML multiple annoyances: as it used ordinary characters as deleimters, such as &lt;code&gt;&amp;lt;&lt;/code&gt;, &lt;code&gt;&amp;gt;&lt;/code&gt;, &lt;code&gt;&amp;amp;&lt;/code&gt;, it means often quoting hell.&lt;/p&gt;
&lt;p&gt;The idea: Use non-ascii-7bits characters as markup!&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Use &lt;code&gt;«foo»&lt;/code&gt; to delimit tags, instead of &lt;code&gt;&amp;lt;foo&amp;gt;&amp;lt;/foo&amp;gt;&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Use these regular elements as escape sequences instead of entities. Escape &lt;code&gt;«&lt;/code&gt; by &lt;code&gt;«-»&lt;/code&gt;. Not really readable — but more than entities — but natural and consistent to parse.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;I wrote the KXF &amp;lt;-&amp;gt; XML converter in Klone, my lisp scripting language, that I definitely need to publish here as part of these legacy series.&lt;/p&gt;
&lt;p&gt;Here is the doc of the format:&lt;/p&gt;
&lt;div style=&quot;background-color: #eeffee;&quot;&gt;
&lt;h1&gt; KXF: The Koala XML Form&lt;/h1&gt;&lt;h2&gt;Purpose&lt;/h2&gt;
    The &lt;b&gt;Koala XML Form&lt;/b&gt; XML avatar has been defined with the following design 
    goals: 
    &lt;ul&gt;
      &lt;li&gt;Ease writing by hand&lt;/li&gt;
      &lt;li&gt;Ease human readability&lt;/li&gt;
      &lt;li&gt;Solve only syntaxic problems
	&lt;ul&gt;
          &lt;li&gt;no entities&lt;/li&gt;
          &lt;li&gt;no DTD&lt;/li&gt;
          &lt;li&gt;no CDATA&lt;/li&gt;
          &lt;li&gt;straightforward whitespace handling&lt;/li&gt;
          &lt;li&gt;get rid of most quoting hell: use less special chars, and use non ascii ones&lt;/li&gt;
        &lt;/ul&gt;&lt;/li&gt;
    &lt;/ul&gt;&lt;h2&gt;Design&lt;/h2&gt;&lt;p&gt;   Here are some examples:
    &lt;table&gt;
        &lt;tr&gt;
          &lt;th&gt;KXF&lt;/th&gt;
          &lt;th&gt;XML&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;&amp;laquo;tag&amp;raquo;&lt;/td&gt;
          &lt;td&gt;&amp;lt;tag/&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;&amp;laquo;tag foo &amp;lt;&gt; bar&amp;raquo;&lt;/td&gt;
          &lt;td&gt;&amp;lt;tag&gt;foo &amp;amp;lt; &amp;amp;gt; bar&amp;lt;/tag&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;&amp;laquo;tag(x=y z=&quot;1 2&quot; t=&#39;gp&#39;) gee&amp;raquo;&lt;/td&gt;
          &lt;td&gt;&amp;lt;tag x=&#39;y&#39; y=&#39;1 2&#39; t=&#39;gp&#39;&gt;gee&amp;lt;/tag&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;&amp;laquo;! comments&amp;raquo;&lt;/td&gt;
          &lt;td&gt;&amp;lt;!-- comments --&gt;&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;&amp;laquo;? PIs&amp;raquo;&lt;/td&gt;
          &lt;td&gt;&amp;lt;?PIs?&gt;&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/table&gt;&lt;p&gt;Quoting special chars:
	&lt;table&gt;
        &lt;tr&gt;
          &lt;th&gt;Char&lt;/th&gt;
          &lt;th&gt;Quoted form&lt;/th&gt;
          &lt;th&gt;Where&lt;/th&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;&amp;laquo;&lt;/td&gt;
          &lt;td&gt;&amp;laquo;-&amp;raquo;&lt;/td&gt;
          &lt;td&gt;character data contents&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;&amp;raquo;&lt;/td&gt;
          &lt;td&gt;&amp;laquo;+&amp;raquo;&lt;/td&gt;
          &lt;td&gt;character data contents&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;&#39;&lt;/td&gt;
          &lt;td&gt;&amp;laquo;!&amp;raquo;&lt;/td&gt;
          &lt;td&gt;attribute values&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;&#39;&lt;/td&gt;
          &lt;td&gt;&amp;laquo;/&amp;raquo;&lt;/td&gt;
          &lt;td&gt;attribute values&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;&quot;&lt;/td&gt;
          &lt;td&gt;&amp;laquo;#&amp;raquo;&lt;/td&gt;
          &lt;td&gt;attribute values&lt;/td&gt;
        &lt;/tr&gt;
        &lt;tr&gt;
          &lt;td&gt;&quot;&lt;/td&gt;
          &lt;td&gt;&amp;laquo;*&amp;raquo;&lt;/td&gt;
          &lt;td&gt;attribute values&lt;/td&gt;
        &lt;/tr&gt;
      &lt;/table&gt;&lt;ul&gt;
      &lt;li&gt;&amp;raquo;&amp;laquo;/tag&amp;raquo; optional ending forms can be used to check nesting as in
     &lt;br&gt;&lt;tt&gt;&amp;laquo;foo a very big contents... &amp;raquo;&amp;laquo;/foo&amp;raquo;&lt;/tt&gt;&lt;ul&gt;
          &lt;li&gt;ending contents is ignored and can be used for comments, as in:
    &lt;br&gt;&lt;tt&gt;&amp;laquo;foo a very big contents... &amp;raquo;&amp;laquo;/foo the main loop&amp;raquo;&lt;/tt&gt;&lt;/li&gt;
          &lt;li&gt;attributes if present must match the starting tag attributes:
    &lt;br&gt;
              &lt;tt&gt;&amp;laquo;foo(x=1) a very big contents... &amp;raquo;&amp;laquo;/foo(x=1)&amp;raquo;&lt;/tt&gt;
             matches, but
    &lt;br&gt;
              &lt;tt&gt;&amp;laquo;foo a very big contents... &amp;raquo;&amp;laquo;/foo(x=2)&amp;raquo;&lt;/tt&gt;
             raises an error
    &lt;/li&gt;
        &lt;/ul&gt;&lt;/li&gt;
      &lt;li&gt; Whitespace around sub-elements are discarded, but not around character data.
 &lt;br&gt;You can keep them 
 by postfixing element name with = (it sets the xml:space attribute to
 &quot;preserve&quot;), such as 
     &lt;br&gt;&lt;tt&gt;&amp;laquo;pre=(a=b) &amp;laquo;b x&amp;raquo; &amp;laquo;i y&amp;raquo;&amp;raquo;&lt;/tt&gt;
 or by enclosing them in the pseudo node &amp;laquo;= &amp;raquo;
&lt;br&gt;&lt;tt&gt;&amp;laquo;x &amp;laquo;=   &amp;raquo; &amp;laquo;y&amp;raquo; &amp;laquo;z&amp;raquo;&amp;raquo;&lt;/tt&gt;
 keeps space before y, but not between y and z
&lt;/li&gt;
      &lt;li&gt;For comfortable use, it is recommended to assign &amp;laquo;&amp;raquo; to 
shift-keypad-minus  and shift-keypad-plus respectively&lt;/li&gt;
      &lt;li&gt;Encodings are raw: either ISO-Latin-1, or UCS2, which can be autodetected 
 as fields must begin with &amp;laquo;&amp;lt;letter&gt; (ISO-Latin-1), \0&amp;laquo; (UCS2), &amp;laquo;\0 (MS UCS2)
&lt;/li&gt;
    &lt;/ul&gt;&lt;h2&gt;Benefits&lt;/h2&gt;&lt;ul&gt;
      &lt;li&gt;More readable&lt;/li&gt;
      &lt;li&gt;Most text editors know how to balance &amp;laquo; and &amp;raquo; better than 
    &amp;lt;foo&gt; and &amp;lt;/foo&gt;&lt;/li&gt;
      &lt;li&gt;It is self sufficient: whitespace handling is explicit&lt;/li&gt;
      &lt;li&gt;No need to quote the common chars &amp;lt;, &gt;, &amp;amp;&lt;/li&gt;
    &lt;/ul&gt;&lt;h2&gt;Drawbacks&lt;/h2&gt;&lt;ul&gt;
      &lt;li&gt;You cannot use XML Tools on this format. Not really a problem, as 
    you can convert to and from XML&lt;/li&gt;
    &lt;/ul&gt;&lt;h2&gt;Tools&lt;/h2&gt;
    For now, there exists only a parser/writer in 
    &lt;a href=&quot;ftp://koala.ilog.fr/klone&quot;&gt;Klone&lt;/a&gt; (&lt;tt&gt;xml-ksf.kl&lt;/tt&gt;, used to implement Klone
    scripts (&lt;tt&gt;xml2kxf&lt;/tt&gt;, &lt;tt&gt;kxf2xml&lt;/tt&gt;) that converts back and forth to XML.
&lt;p&gt;A java SAX parser is planned
&lt;h2&gt;Author&lt;/h2&gt;&lt;a href=&quot;http://colas,nahaboo.net&quot;&gt;Colas Nahaboo&lt;/a&gt;&lt;hr&gt;&lt;a href=&quot;index.html&quot;&gt;Back to XML Avatars&lt;/a&gt;
&lt;/div&gt;
</content>
        
    </entry>
</feed>
