为xml文件中的单个属性传递两个不同的值 [英] Pass two different value for single attribute in xml file

查看:96
本文介绍了为xml文件中的单个属性传递两个不同的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,

看起来很傻,但是我的客户要求就是这样.
我想在单个xml标记中传递两个具有单个名称的参数.

例如

Hi all,

It may look silly, but my client requirement is like that.
I want to pass two parameters with a single name in a single xml tag.

For example

<book name="Need" name="Help" price="$20">
</ book> 


是否可以传递上述xml标记?
如果可能的话我该怎么办?
任何提示或技巧将不胜感激.

感谢advace.


Is it possible to pass the above mentioned xml tag?
If its possible how can i?
Any tips or tricks will be greatly appreciated.

Thanks in advace.

推荐答案

20" < / >


是否可以传递上述xml标记?
如果可能的话我该怎么办?
任何提示或技巧将不胜感激.

谢谢你.


Is it possible to pass the above mentioned xml tag?
If its possible how can i?
Any tips or tricks will be greatly appreciated.

Thanks in advace.


不,这是不可能的.节点内的属性必须唯一.而且它也区分大小写.

也许您可能更喜欢
No, this is not possible. The Attributes within a node must be unique. And it is case-sensitive as well.

Probably you may prefer something like
<book>
<name>Need</name>
<name> Help </name>
</book>



并且如果它达到了目的.但这会使您的XML繁重且效率低下.

谢谢
Milind



And if it served the purpose. But it will make your XML heavy and bit inefficient.

Thanks
Milind


我选择了另一种方法来解决上述问题.
而不是传递两个值,而是通过另一种方式传递(由于安全策略,我无法分享对不起家伙的方式!!)

现在它运作良好,很好!
I choose another way to resolve the above issue.
Instead of passing two values i passed in another way(due to security policy i could not share the way i did sorry guys!!!)

Now its working well and good !


这篇关于为xml文件中的单个属性传递两个不同的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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