title: how to set default values for attributes in xml using DTD?
body: <p>How do i set default values for attributes in xml. Consider below test.xml. An attribute 'gender' with default value 'male' has been defined for element 'to'. I am however unable to retrieve it using xmlstarlet. Am i doing something wrong? Please help.</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;!DOCTYPE message [
    &lt;!ELEMENT message (to,from,subject,text)&gt;
    &lt;!ELEMENT to       (#PCDATA)&gt;
    &lt;!ELEMENT from     (#PCDATA)&gt;
    &lt;!ELEMENT subject  (#PCDATA)&gt;
    &lt;!ELEMENT text     (#PCDATA)&gt;
    &lt;!ATTLIST to gender CDATA "male"&gt;
  ]&gt;
  
  &lt;message&gt;
    &lt;to&gt;Dave&lt;/to&gt;
    &lt;from&gt;Susan&lt;/from&gt;
    &lt;subject&gt;Reminder&lt;/subject&gt;
    &lt;text&gt;Dont forget to buy milk on the way home.&lt;/text&gt;
  &lt;/message&gt;
  </code></pre>
  
  <p>xmlstarlet cmd: (doesnt print anything to stdout)</p>
  
  <pre><code>xmlstarlet sel -T -t -m "//message/to" -v "@gender" -n test.xml
  </code></pre>