Take type/label from XML node

Get help using Construct 2

Post » Fri Jul 10, 2015 7:14 am

I want get name/label from node (" <line id="a"> </line>" , where I want get that "line" )

My plan is use it for make a sequence of events, but of course, the events must follow the node list order, but for parse the events I want know which type of event is.

my example XML:
Code: Select all
<?xml version="1.0" encoding="UTF-8"?>
<!-- char 0 = narrador -->
<visualnovel>
   <scenes>
      <scene id="start">
                         <show s="t">smile</show>
          <line s="t">
            Hello
          </line>
         <line s="t">
            What doing here?
         </line>
      </scene>
   </scenes>
</visualnovel>


I already found this post: viewtopic.php?f=147&t=95759&p=739371&hilit=xml+reference#p739371

I'm using this inside a normal for each xml, but it not recovers nothing: XML.StringValue("name()")

I can move inside the for each node by node with this : /visualnovel/scenes/scene [@id="start"]/*[ "&actualnode&"]

There is somebody here witch used "name()" with sucess ? there is an alternative? thanks you.
B
11
S
2
Posts: 21
Reputation: 1,171

Post » Fri Jul 10, 2015 3:22 pm

Improved Question

Edit:

I'm using Xpath visualizer tool http://xpathvisualizer.codeplex.com and I can't even make it work there. There is something I'm doing bad and perhaps it's out from construct scope
B
11
S
2
Posts: 21
Reputation: 1,171

Post » Fri Jul 10, 2015 4:02 pm

I remember having used the name() function successfully, but I can't seem to be able to get it to work now... Maybe a bug ?

edit: Okay, I think I know why I can't get it to work anymore. I'm currently using Firefox for my test, and there's a workaround for some Firefox related problem implemented in the XML plugin. Strangely, the workaround isn't needed when using the name() function. Testing with IE fails too, although I don't know why... Chrome and NW.js works like a charm!
B
71
S
30
G
25
Posts: 984
Reputation: 19,503

Post » Fri Jul 10, 2015 7:18 pm

You are right. Works only under chrome ( I was trying under firefox, like you). I will update with test under mobile browsers.

Thanks you, Magistross, I was expecting something from you, like I already read almost everything about xml at this forums.
B
11
S
2
Posts: 21
Reputation: 1,171

Post » Mon Jul 13, 2015 8:14 am

Ok, its confirmed:
Works
On desktop:
Yes:
chrome
No:
Firefox


On android:
Yes:
Dolphin
Android standard navigator
Chrome
No:
Firefox (again!)
B
11
S
2
Posts: 21
Reputation: 1,171


Return to How do I....?

Who is online

Users browsing this forum: Google [Bot], Jackriduk, kiki4construct, osek95 and 23 guests