Last week, we had the author of TDD for a Shopping Website LiveProject. Friday at 11am Ranch time, Steven Solomon will be hosting a live TDD session just for us. See for the agenda and registration link
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Problem adding to xml

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
I am adding email addresses to an xml file, I need to select a certain user and then add an email address to that user, the code works for one user with:
<xtags:forEach select="/configuration/users/user/emails">
(plus the xtags:add code as below)
But when you add an email address to another user it adds it to the first users email as it does not know which user it is dealing with, so as you can see below I am including <%username%> in the xtags statement, however this code now does not add to the xml file at all, no errors either. Does anyone have any ideas why this doesn't work, or how it should be done
<xtags:forEach select="/configuration/users/user[username='<%=username%>']/emails">
<xtags:add><%--
--%><email><%--
--%><num><%= num %></num><%--
--%><emailuser><%= emailuser %></emailuser><%--
--%><emailpassword><%= emailpassword %></emailpassword><%--
--%><emailserveraddress><%= emailserveraddress %></emailserveraddress><%--
--%><emailproto><%= emailproto %></emailproto><%--
--%></email><%--
--%></xtags:add>
</xtags:forEach>
 
Sharon Cowling
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Does anyone have any ideas about this? Do I need to provide more information?
 
What do you have in that there bucket? It wouldn't be a tiny ad by any chance ...
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic