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

access xml-nodes from xml file

Avatar

Avatar
Validate 1
Level 2
arthurf48713214
Level 2

Likes

8 likes

Total Posts

30 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Validate 1
Level 2
arthurf48713214
Level 2

Likes

8 likes

Total Posts

30 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile
arthurf48713214
Level 2

07-05-2018

Hello,

how can i access a node of a xml-file

looks like this:

<RootNode>

     <EntryNode>

          <ColumnA>Some Value A</ColumnA>

          <ColumnB>Some Value B</ColumnB>

     </EntryNode>

     <EntryNode>

          <ColumnA>Some Value C</ColumnA>

          <ColumnB>Some Value D</ColumnB>

     </EntryNode>

</RootNode>

thanks for your help

Accepted Solutions (1)

Accepted Solutions (1)

Avatar

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

270 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

270 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile
_Bruce_Robertson
MVP

08-05-2018

Hi,

I'm guessing you mean reference it in JavaScript code rather than binding a field to it and using the rawValue?

In JavaScript $data is a reference to the Data DOM, so

$data.resolveNode('RootNode')                                                                 // refers to your root node
$data.resolveNodes('RootNode.EntryNode[*]').length                               // returns 2
$data.resolveNodes('RootNode.EntryNode[*].ColumnA').item(1).value    // returns "Some Value C"

Bruce

Answers (3)

Answers (3)

Avatar

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

270 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile

Avatar
Boost 50
MVP
_Bruce_Robertson
MVP

Likes

270 likes

Total Posts

1,782 posts

Correct Reply

372 solutions
Top badges earned
Boost 50
Boost 5
Boost 3
Boost 250
Boost 25
View profile
_Bruce_Robertson
MVP

08-05-2018

Do you have some fields bound to EntryNode or ColumnA, etc.  If so and they have a min occurs of 1 then an EntryNode will be created in the Data DOM.

Avatar

Avatar
Validate 1
Level 2
arthurf48713214
Level 2

Likes

8 likes

Total Posts

30 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Validate 1
Level 2
arthurf48713214
Level 2

Likes

8 likes

Total Posts

30 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile
arthurf48713214
Level 2

08-05-2018

thks alot.

Avatar

Avatar
Validate 1
Level 2
arthurf48713214
Level 2

Likes

8 likes

Total Posts

30 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile

Avatar
Validate 1
Level 2
arthurf48713214
Level 2

Likes

8 likes

Total Posts

30 posts

Correct Reply

0 solutions
Top badges earned
Validate 1
Boost 5
Boost 3
Boost 1
Applaud 5
View profile
arthurf48713214
Level 2

08-05-2018

Thanks so much bruce.

I have another problem.

<RootNode>

     <EntryNode>

          <ColumnA>Some Value A</ColumnA>

          <ColumnB>Some Value B</ColumnB>

     </EntryNode>

</RootNode>

$data.resolveNodes('RootNode.EntryNode[*]').length                               // it returns 1

<RootNode>

</RootNode>

$data.resolveNodes('RootNode.EntryNode[*]').length                               // it returns 1  why not 0

Arthur