XML - Reading attributes of an element

Get help using Construct 2

Post » Thu Dec 05, 2013 11:46 pm

Hi

Tried searching all over the place over here but can't find it.

It there a way or can you please direct me to the right source of how to list attributes of an element and their values in xml.

Example taken from tiled but can be any other type of xml

<map version="1.0" orientation="orthogonal" width="20" height="15" tilewidth="32" tileheight="32">

I need my program to list these attributes and the corresponding value after having the actual xml file stored as a sting using the XML Plugin.

Thanks


AbelaNET2013-12-05 23:49:43
Cyberphaze

What we build can never be destroyed
B
136
S
18
G
6
Posts: 37
Reputation: 14,784

Post » Fri Dec 06, 2013 8:43 am

I found this using search that may be of use:

http://www.scirra.com/forum/xml-loop_topic79022.html
If your vision so exceeds your ability, then look to something closer.
Moderator
B
136
S
31
G
86
Posts: 5,486
Reputation: 59,758

Post » Fri Dec 06, 2013 10:47 am

Thanks, saw that link but what if you have no clue what the attributes are and these can also vary in number.

Using an XPath Utility it is listing the attributes and values using /map/@* but I am not an expert in this field hence I need to implement that using C2
Cyberphaze

What we build can never be destroyed
B
136
S
18
G
6
Posts: 37
Reputation: 14,784


Return to How do I....?

Who is online

Users browsing this forum: banquetburger and 48 guests