Add WriteAttributeString sample code.