如何访问xml文档中的自定义属性? [英] How to get acces to custom attributes in a xml document?

查看:142
本文介绍了如何访问xml文档中的自定义属性?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图从自定义标记中获取值< tickets>超出XML文件。

Im trying to get the value from a custom tag <tickets> out of an XML file.

到目前为止,我发现我可以使用SyndicationAtribute执行此操作,但我不知道具体如何

So far I found out I can use SyndicationAtribute to do this but I don't know how exactly

 foreach (SyndicationItem feedItem in currentFeed.Items)
            {
                SampleDataItem dataItem = new SampleDataItem();
                SampleDataGroup dataGroup = null;

                SyndicationAttribute value;
                
                dataItem.Title = feedItem.Title.Text;

                dataItem.Tickets = 
                //How can i get access to the <tickets> attribute?
            }

推荐答案

Hi Osorio_Omar,

Hi Osorio_Omar,

如果它是一个Element标签,你可以使用
SyndicationItem.ElementExtensions
属性来读取它。它在
Loosely-Typed Extensions Sample
中进行了演示。

If it's an Element tag, you can use SyndicationItem.ElementExtensions property to read it. It is demonstrated in Loosely-Typed Extensions Sample.

祝你好运,


这篇关于如何访问xml文档中的自定义属性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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