WebMake: Documentation: The <attrdefault> Tag

WebMake Documentation (version 1.1) | [ Back | Forward | Index | All In One ]

# The <attrdefault> Tag Attributes are usually specified inside a content item's <content> or <contents> tags, or, for output files, inside the <out> tag. However, this can be a chore if you have many items to set attributes on, so, to make things easier, you can specify default attributes using the <attrdefault> tag. Specify this tag before the content items or output files in question, and those items will all be tagged with the attributes you set. Like the metadefault tag, this tag can be used either in a scoped mode, or in a command mode. ### Scoped Mode "Scoped" mode uses opening (<attrdefault>) and closing (</attrdefault>) tags; the attributes are only set on content items or output files between the two tags. Note! one warning about "scoped" mode: note that WebMake does not use a fully-correct XML parser to parse the XML in the .wmk file, so if you nest <attrdefault> tags, it will not correctly parse them; instead, the first closing </attrdefault> tag found will be used. ### Command Mode Command mode uses standalone tags (<attrdefault ... />); the attributes are set until the end of the WebMake file, or until you change them with another <attrdefault> tag. # Attributes name the attribute's name, e.g. up, map, etc. This is required. value the attribute's value. This is optional. If the value is not specified, the attribute will be removed from the list of default attributes. # Example Using the scoped style:
      <attrdefault name="format" value="text/html">
        <content name="chunk_1.txt">...</content>
        <content name="chunk_2.txt">...</content>
        <content name="chunk_3.txt">...</content>
        <content name="chunk_4.txt">...</content>
      </attrdefault>
Or, in the "command" style:
      <attrdefault name="format" value="text/html" />

      <content name="chunk_1.txt">...</content>
      <content name="chunk_2.txt">...</content>
      <content name="chunk_3.txt">...</content>
      <content name="chunk_4.txt">...</content>

      <attrdefault name="format" />

WebMake Documentation (version 1.1) | [ Back | Forward | Index | All In One ]