Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn More

View all

Sign in to view all badges

How to get the value of one attribute based on the value of another in xml in content

Avatar

Avatar
Validate 1
Level 1
jx62030937
Level 1

Like

1 like

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile

Avatar
Validate 1
Level 1
jx62030937
Level 1

Like

1 like

Total Posts

2 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 1
View profile
jx62030937
Level 1

15-10-2018

Hi,

Sorry for the mouthful in the title. Please see example below:

<xml>

     <object id="1" val="value" />

     <object id="2" val="value2" />

     <object1>

          <id1>value</id1>

          <id2>value2</id2>

     </object1>

</xml>

Referring to the first two nodes, in bold; If I'm trying to get the value of the attribute "val" based on the value of the attribute "id", what would be the syntax here. The typical syntax is <%= targetData.xml.object1.id1 %> for example.

Much appreciate it!

Jim

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Contributor
MVP
wodnicki
MVP

Likes

941 likes

Total Posts

1,061 posts

Correct Reply

499 solutions
Top badges earned
Contributor
Shape 1
Give Back 100
Give Back 50
Give Back 25
View profile

Avatar
Contributor
MVP
wodnicki
MVP

Likes

941 likes

Total Posts

1,061 posts

Correct Reply

499 solutions
Top badges earned
Contributor
Shape 1
Give Back 100
Give Back 50
Give Back 25
View profile
wodnicki
MVP

07-01-2019

Hi,

You have to look it up with the id attribute:

<%= targetData.xml.object.(@id == targetData.xml.object1.id1).val %>

Thanks,

-Jon

Answers (0)