SharePoint Tip of the Day – Provide default value for your list instance with special characters.


Whenever you need to provide default values for your list that contains special characters like "<" "&" and so on, don't forget to encapsulate them in CDATA, neither the html entity name nor the entity number is working…

  <ListInstance
    FeatureId="{C6E862CB-BA2B-4976-A6B6-FFB162872F56}"
    Title="Power"
    Url="Lists/Power"
    Description="Power items list that will store and manage the various power values."
    OnQuickLaunch="TRUE"
    TemplateType="10001">

    <Data>
      <Rows>
        <Row>
          <Field Name='ID'>1</Field>
          <Field Name='Title'><![CDATA[<10W]]></Field>
        </Row>
        <Row>
          <Field Name='ID'>2</Field>
            <Field Name='Title'>10 – 50W</Field>
        </Row>
        <Row>
          <Field Name='ID'>3</Field>
            <Field Name='Title'>50 – 100W</Field>
        </Row>
        <Row>
            <Field Name='ID'>4</Field>
            <Field Name='Title'>100 – 150W</Field>
        </Row>
        <Row>
            <Field Name='ID'>5</Field>
            <Field Name='Title'>150 – 250W</Field>
        </Row>
        <Row>
            <Field Name='ID'>6</Field>
            <Field Name='Title'>250 – 600W</Field>
        </Row>
        <Row>
            <Field Name='ID'>7</Field>
            <Field Name='Title'><![CDATA[> 600W]]></Field>
        </Row>
      </Rows>
    </Data>

  </ListInstance>

François