Wcf 关于属性名称的问题

Wcf 关于属性名称的问题,wcf,sharepoint,Wcf,Sharepoint,Xml文档 关于来自sharepoint的xml属性名称,我遇到了一个问题,其中包含了xmldoc中的属性名称,如description0、ows_x0020_long_desc <z:row ows_LinkFilename="Aerospace Energy.jpg" ows_Title="Aerospace" ows_ContentType="Image" ows__ModerationStatus="0" ows_PreviewOnForm=

Xml文档

关于来自sharepoint的xml属性名称,我遇到了一个问题,其中包含了xmldoc中的属性名称,如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" />


您能告诉我这个问题的解决方案吗。

SharePoint在返回xml数据时将始终使用此fromat

  • 字段名将以ows开头_
  • 将使用字段的内部名称,而不是显示名称
  • SharePoint中的内部字段名包含特殊字符的unicode等价物
    e、 g.如果您从SharePoint UI创建名为“field name”的字段, SharePoint将创建内部名称为“Field\u x0020\u name” 其中0020是空间的unicode表示

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

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


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

SharePoint在返回xml数据时将始终使用此fromat

  • 字段名将以ows开头_
  • 将使用字段的内部名称,而不是显示名称
  • SharePoint中的内部字段名包含特殊字符的unicode等价物
    e、 g.如果您从SharePoint UI创建名为“field name”的字段, SharePoint将创建内部名称为“Field\u x0020\u name” 其中0020是空间的unicode表示

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

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


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

那么您有什么问题?那么您有什么问题?回答得好。您还应该提到,x0020只是空格字符的unicode表示法:感谢您指出,我错写了十六进制而不是unicode,所以这是一个很好的答案。您还应该提到,x0020只是空格字符的unicode表示:感谢您指出,我错写了十六进制而不是unicode,因此更正了它