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

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s