【问题标题】:Issue regarding the Attribute Names关于属性名称的问题
【发布时间】:2011-12-07 06:45:05
【问题描述】:

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" />

请您告诉解决方法。

【问题讨论】:

  • 那么你的问题是什么?

标签: wcf sharepoint


【解决方案1】:

在 xml 中返回数据时,SharePoint 将始终使用这个 fromat。

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

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

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


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

【讨论】:

猜你喜欢
  • 2021-10-08
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2011-09-28
  • 2011-08-04
  • 1970-01-01
相关资源
最近更新 更多