有关属性名称的问题

时间:2011-12-07 06:45:05

标签: wcf sharepoint

Xml文档

我遇到的问题是来自sharepoint的xml属性名称,其中包含属于x0ldoc的description0,ows_x0020_long_desc等属性名称

    <z:row ows_LinkFilename="Aerospace Energy.jpg" 
   ows_Title="Aerospace" 
   ows_ContentType="Image" 
   ows__ModerationStatus="0" 
   ows_PreviewOnForm="Aerospace Energy.jpg" 
   ows_ThumbnailOnForm="Technology Experience/Aerospace Energy.jpg" 
   ows_Modified="2011-12-07 12:02:34" 
   ows_Editor="1073741823;#System Account" 
   ows_Description0="Honeywell's SmartPath® Ground-Based Augmentation System (GBAS), which offers airports improved efficiency and capacity, greater navigational accuracy, and fewer weather-related delays." 
   ows_ID="28" 
   ows_Created="2011-12-02 11:26:01" 
   ows_Author="1073741823;#System Account" 
   ows_FileSizeDisplay="6091" 
   ows_Mode="Energy" 
   ows_Solution="Business" 
   ows_Long_x0020_Desc="Honeywell's SmartTraffic™ and IntuVue® 3-D Weather Radar technologies make the skies safer and enable pilots to more efficiently route flights. SmartTraffic ." 
   ows_Brief_x0020_Desc="Honeywell's Required Navigation Performance (RNP) capabilities enable aircraft to fly more precise approaches through tight corridors and congested airports, leading to fewer delays." 
   ows_Tags="True" 
   ows__Level="1" 
   ows_UniqueId="28;#{928FDA3E-94FA-47A5-A9AD-B5D98C12C18C}" 
   ows_FSObjType="28;#0" 
   ows_Created_x0020_Date="28;#2011-12-02 11:26:01" 
   ows_ProgId="28;#" 
   ows_FileRef="28;#Technology Experience/Aerospace Energy.jpg" 
   ows_DocIcon="jpg" 
   ows_MetaInfo="28;#Solution:SW|Business vti_thumbnailexists:BW|true vti_parserversion:SR|14.0.0.4762 Category:SW|Enter Choice #1 Description0:LW|Honeywell's SmartPath® Ground-Based Augmentation System (GBAS), which offers airports improved efficiency and capacity, greater navigational accuracy, and fewer weather-related delays. vti_stickycachedpluggableparserprops:VX|wic_XResolution Subject vti_lastheight vti_title vti_lastwidth wic_YResolution oisimg_imageparsedversion vti_lastwidth:IW|294 vti_author:SR|SHAREPOINT\\system vti_previewexists:BW|true vti_modifiedby:SR|SHAREPOINT\\system Long Desc:LW|Honeywell's SmartTraffic™ and IntuVue® 3-D Weather Radar technologies make the skies safer and enable pilots to more efficiently route flights. SmartTraffic . Keywords:LW| vti_foldersubfolderitemcount:IR|0 vti_lastheight:IW|172 ContentTypeId:SW|0x0101009148F5A04DDD49CBA7127AADA5FB792B00AADE34325A8B49CDA8BB4DB53328F21400623D4FCEEB2ADC4EA8269BF873F0BB6F _Author:SW| vti_title:SW|Aerospace wic_System_Copyright:SW| Mode:SW|Energy Tags:SW|True wic_YResolution:DW|96.0000000000000 oisimg_imageparsedversion:IW|4 Brief Desc:LW|Honeywell's Required Navigation Performance (RNP) capabilities enable aircraft to fly more precise approaches through tight corridors and congested airports, leading to fewer delays. _Comments:LW| wic_XResolution:DW|96.0000000000000 Subject:SW|Aerospace vti_folderitemcount:IR|0" 
   ows_Last_x0020_Modified="28;#2011-12-07 12:02:34" 
   ows_owshiddenversion="6" 
   ows_FileLeafRef="28;#Aerospace Energy.jpg" 
   ows_PermMask="0x7fffffffffffffff" 
   xmlns:z="#RowsetSchema" />

请你告诉解决方案。

1 个答案:

答案 0 :(得分:3)

在xml中返回数据时,SharePoint将始终使用此格式。

  • 字段名称将以ows _
  • 为前缀
  • 将使用字段的内部名称而不是显示名称。
  • SharePoint中的内部字段名称包含特殊字符的unicode等效项 例如如果您从SharePoint UI创建名称为“字段名称”的字段,     SharePoint将内部名称创建为“Field_x0020_Name”     其中0020是空间的unicode表示。

    如果字段是由代码或功能创建的,则您可以指定自己的内部和显示名称。

因此,如果要解析此类xml,则必须编写代码来记住这些规则。


SharePoint不会在字段的内部名称中添加 x0020 转义序列,除非在从UI创建字段时显示名称中有空格。 此外,创建字段后,更改显示名称不会影响字段的内部名称。 因此,如果您从UI创建字段'Long Desc',然后将名称更改为'LongDesc',则内部名称仍为Long_x0020_Desc。