关于属性名称的问题 [英] Issue regarding the Attribute Names

查看:50
本文介绍了关于属性名称的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

XML 文档

我在来自 sharepoint 的 xml 属性名称方面遇到问题,其中包含 xmldoc 中的 description0、ows_x0020_long_desc 等属性名称

I am having a problem regarding the xml attribute names coming from sharepoint which contains the attributes names like description0,ows_x0020_long_desc coming in the xmldoc

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

你能告诉我这个问题的解决方案吗.

Could you please tell the solution for this.

推荐答案

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

SharePoint when returning data in xml will always use this fromat.

  • 字段名称将以 ows_ 开头
  • 将使用字段的内部名称而不是显示名称.
  • SharePoint 中的内部字段名称包含特殊字符的 Unicode 等效项
    例如如果您从 SharePoint UI 创建名为字段名称"的字段,SharePoint 将创建内部名称为Field_x0020_Name"其中 0020 是空间的 Unicode 表示.

  • Field names will be prepended by ows_
  • Internal names of field will be used not display names.
  • Internal field names in SharePoint contain unicode equivalents for special characters
    e.g. if you create a field with name 'Field Name' from SharePoint UI, SharePoint will create internal name as 'Field_x0020_Name' where 0020 is unicode representation of space.

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

If fields are created by code or feature however you can specify your own internal and display names.

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

So if you are parsing such xml you will have to code remembering these rules.

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

SharePoint does not add x0020 escape sequence in field's internal name unless there is a space in the display name while creating the field from UI. Also once the field is created, changing the display name has no effect on the internal name of a field. So if you create a field 'Long Desc' from UI and the later change the name to 'LongDesc', the internal name will still be Long_x0020_Desc.

这篇关于关于属性名称的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆