xml

Avatar

Avatar
Level 5
_jerome_dinnat_
Level 5

Likes

0 likes

Total Posts

180 posts

Correct reply

0 solutions
View profile

Avatar
Level 5
_jerome_dinnat_
Level 5

Likes

0 likes

Total Posts

180 posts

Correct reply

0 solutions
View profile
_jerome_dinnat_
Level 5

28-07-2008

Hi, <br /><br />In a process I have two forms with the same xml schema. I need to copy nodes from the formA to the formB.<br /><br />My problem is in my xml schema I have nodes with maxOccurs = unbounded and I want to pass to the formB only a few of this nodes to the formB.<br /><br />exemple : <br /><br /><FormA><br /> <InfoN><br /> ...<br /> </InfoN><br /> <InfosFils><br /> <login>Jerome</login><br /> ...<br /> </InfosFils><br /> <InfosFils><br /> <login>Marc</login><br /> ...<br /> </InfosFils><br /> <InfosFils><br /> <login>Mikael</login><br /> ...<br /> </InfosFils><br /> <InfosFils><br /> <login>Linda</login><br /> ...<br /> </InfosFils><br /></FormA><br /><br />I want to pass only the nodes <InfosFils> for jerome and linda for example.<br />(In fact, it depend on a variable compt of type int in a loop)<br />I can't do for jerome for example in the setValue : <br /><br />location : <br /><br />/process_data/FormB/object/data/xdp/datasets/data/FormulaireB/InfoFils[1]<br /><br />expression : <br /><br />the info of jerome<br /><br />because the formB is empty and InfoFils[1] doesn't exist.<br /><br />If I do : <br /><br />location : <br /><br />/process_data/FormB/object/data/xdp/datasets/data/FormulaireB<br /><br />and expression : <br /><br />/process_data/FormB/object/data/xdp/datasets/data/FormulaireB/InfoFils[1]<br /><br />It copy the node I want but delete all the other nodes under FormulaireB<br /><br />and if I do the same for linda for example : <br /><br />/process_data/FormB/object/data/xdp/datasets/data/FormulaireB/InfoFils[3]<br /> <br /><br />It will erase the Info of jerome.<br /><br />I don't know how do that. Need I use the xslt transformation ? Or create a component ? Can I use the DOM methodes to create nodes in the setValue ?<br /><br />Thanks for any advice

Replies

Avatar

Avatar
Level 5
_jerome_dinnat_
Level 5

Likes

0 likes

Total Posts

180 posts

Correct reply

0 solutions
View profile

Avatar
Level 5
_jerome_dinnat_
Level 5

Likes

0 likes

Total Posts

180 posts

Correct reply

0 solutions
View profile
_jerome_dinnat_
Level 5

28-07-2008

I think I will try to create my xml into a string variable and then copy it under the root of my formB but it seems to be complicated 😞



Edit : It seems to work with small files. Need to test with more data

Avatar

Avatar
Boost 5
Level 9
HowardTreisman
Level 9

Likes

5 likes

Total Posts

936 posts

Correct reply

9 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Affirm 5
Affirm 3
View profile

Avatar
Boost 5
Level 9
HowardTreisman
Level 9

Likes

5 likes

Total Posts

936 posts

Correct reply

9 solutions
Top badges earned
Boost 5
Boost 3
Boost 1
Affirm 5
Affirm 3
View profile
HowardTreisman
Level 9

28-07-2008

Hi Jerome

There are a couple of techniques you can use:

1. Simple XPath

Try /process_data/FormA/InfosFils[login='Jerome' or login='Marc']

There are other ways you could do this.

2. XSLT - ships with Livecycle

3. XQuery component.

4. XMLUtil component



You can find examples of XMLUtil and XQuery here, and download a trial off our web site.:

http://avoka.dnsalias.com/confluence/display/Public/Inserting+XML+data+into+a+form+variable

http://avoka.dnsalias.com/confluence/display/Public/Transforming+XML+Documents



Howard

Avatar

Avatar
Level 5
_jerome_dinnat_
Level 5

Likes

0 likes

Total Posts

180 posts

Correct reply

0 solutions
View profile

Avatar
Level 5
_jerome_dinnat_
Level 5

Likes

0 likes

Total Posts

180 posts

Correct reply

0 solutions
View profile
_jerome_dinnat_
Level 5

28-07-2008

Thanks,



My issue was not to access node Jerome or linda but to create the nodes in the second form. I did it by creating the xml in a string with serialize and concat function and at the end deserialize this string into the xml I needed.

Avatar

Avatar
Level 5
_jerome_dinnat_
Level 5

Likes

0 likes

Total Posts

180 posts

Correct reply

0 solutions
View profile

Avatar
Level 5
_jerome_dinnat_
Level 5

Likes

0 likes

Total Posts

180 posts

Correct reply

0 solutions
View profile
_jerome_dinnat_
Level 5

30-07-2008

Hi,



In a setValue,



location :



/process_data/MyXml



Expression :



deserialize(/process_data/@MyStringXml)

Avatar

Avatar
Coach
Level 10
Jasmin_Charbonn
Level 10

Likes

149 likes

Total Posts

2,154 posts

Correct reply

97 solutions
Top badges earned
Coach
Give Back 1000
Give back 900
Give Back 800
Give back 600
View profile

Avatar
Coach
Level 10
Jasmin_Charbonn
Level 10

Likes

149 likes

Total Posts

2,154 posts

Correct reply

97 solutions
Top badges earned
Coach
Give Back 1000
Give back 900
Give Back 800
Give back 600
View profile
Jasmin_Charbonn
Level 10

05-08-2008

You can use the function deserialize(node) in the xPath builder.



Jasmin