Click here to Skip to main content
15,891,908 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
XML
<book name="Need" name="Help" price="$20">
</ book> 

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.
Posted
Comments
Jim Jos 17-Oct-12 8:50am    
Why don't you comebine the values with a commma or semicolon spearator? like Name=Need,Help etc?
♥…ЯҠ…♥ 17-Oct-12 8:52am    
Thanks pal, I've tried the way you mentioned, but ended up with nothing.
Is there any possible way to achieve the same?
Jim Jos 17-Oct-12 8:54am    
could post the code? I presume you are using some language to create the xml?

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
XML
<book>
<name>Need</name>
<name> Help </name>
</book>


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

Thanks
Milind
 
Share this answer
 
v2
Comments
♥…ЯҠ…♥ 17-Oct-12 8:54am    
Yeah buddy, i did the same as you mentioned, but could not get the result !! sighs !!
MT_ 17-Oct-12 8:59am    
Did not get result ? You mean you did not get approval from client ? or you are facing some technical issue ?
♥…ЯҠ…♥ 17-Oct-12 9:23am    
Did'nt get expected result....
MT_ 17-Oct-12 9:25am    
Alright, So I assume you are having technical problem. Can you please update us with details about code tried and issue faced in node approach rather than attribute approach ? Then only I or anyone will be able to help.
♥…ЯҠ…♥ 17-Oct-12 9:40am    
I tried the below mentioned options,

1)<book name="Need" price="$20">
2) <book><name>Need<name> Help
3) <book name="Need,Help">

But not happy about the tags... sighs!!! is there any other option to achieve?
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 !
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900