English 中文(简体)
Pivotviewer s.cxml parsing
原标题:Pivotviewer s .cxml parsing

I m试图在.cxml文档上进行非常简单的操作。 如你所知,它基本上属于<代码>xml。 这是为测试申请而创建的样本文件一:

<?xml version="1.0" encoding="utf-8"?>
<Collection xmlns:p="http://schemas.microsoft.com/livelabs/pivot/collection/2009" SchemaVersion="1.0" Name="Actresses" xmlns="http://schemas.microsoft.com/collection/metadata/2009">
  <FacetCategories>
    <FacetCategory Name="Nationality" Type="LongString" p:IsFilterVisible="true" p:IsWordWheelVisible="true" p:IsMetaDataVisible="true" />
  </FacetCategories>
<!-- Other entries-->
  <Items ImgBase="Actresses_filesgo144bwo.0ao.xml" HrefBase="http://www.imdb.com/name/">    
    <Item Id="2" Img="#2" Name="Anna Karina" Href="nm0439344/">
      <Description> She is a nice girl</Description>
      <Facets>
        <Facet Name="Nationality">
          <LongString Value="Danish" />
        </Facet>
      </Facets>
    </Item>    
  </Items>
<!-- Other entries-->
</Collection>

我拿不出任何运作简单的法典,如:

XDocument document = XDocument.Parse(e.Result);
foreach (XElement x in document.Descendants("Item"))
{
...
}

通用<代码>xml的测试正在进行。 <编码>cxml文档在文件上正确载荷。

在观察这一表述时:

文件:结果

答案是:

就业“计算结果没有结果”

是否有错误? 我也急切地看到脸部、面孔等的主人,但是在列举方面没有任何结果。 这显然与用于测试的通用<代码>xml文档一发生。 这个问题与<代码>cxml有关。

最佳回答

Basically your XML defines a default namespace with the xmlns="http://schemas.microsoft.com/collection/metadata/2009" attribute:

这就是说,你需要完全符合您的申述人的要求,例如:

XDocument document = XDocument.Parse(e.Result);
foreach (XElement x in document.Descendants("{http://schemas.microsoft.com/collection/metadata/2009}Item"))
{
...
}

如果你将违约国名空间从XML中删除,则你的实际操作是,但这不是演习的目标。

问题回答




相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

NSArray s, Primitive types and Boxing Oh My!

I m pretty new to the Objective-C world and I have a long history with .net/C# so naturally I m inclined to use my C# wits. Now here s the question: I feel really inclined to create some type of ...

C# Marshal / Pinvoke CBitmap?

I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...

How to Use Ghostscript DLL to convert PDF to PDF/A

How to user GhostScript DLL to convert PDF to PDF/A. I know I kind of have to call the exported function of gsdll32.dll whose name is gsapi_init_with_args, but how do i pass the right arguments? BTW, ...

Linqy no matchy

Maybe it s something I m doing wrong. I m just learning Linq because I m bored. And so far so good. I made a little program and it basically just outputs all matches (foreach) into a label control. ...