Jump to content
UBot Underground

XML Change/Add in certain area's


Recommended Posts

Hello Ubotters, 


I have the following completed: 
If XML contains a Table Cell Value(ID) 

 
Now I'm trying to 
If the ID is in the XML, then add a child under the last Child node of the ID
If the ID is NOT in the XML, I want it to create a new element under the last element. 
 
I search the XML ID list with xpath praser for ID: R103828466
 
ID is in XML 
It then will go to that element, go under the last Data(Child) Element, and insert a new "Data" child element. 
 
ID is NOT in XML
It then will go to the very last "Member" element and insert a new "Member" Element with the Attributes then add a Data(Child) Element under the new Member element.
 
Then I'm also trying to change a certain Attribute. 
Change R103828466 MemberUntil value.

I think I'm missing something that is common, but XML with UBot is new to me. 

XML: 
 
<?xml version="1.0"?>
<AccountManager>
  <Member id="R103828466" MemberSince="2014/09/09" MemberUntil="12/31/3030">
    <Data id="1" Last="2014/10/05" Amount="34">
    </Data>
  </Member>
  <Member id="R104950769" MemberSince="2014/08/25" MemberUntil="12/31/3030">
    <Data id="1" Last="2014/10/06" Amount="46">
-------------------------------------------------------If the ID is in the XML, then add a child under the last Child node of the ID
    </Data>
  </Member>
  <Member id="R105836511" MemberSince="2014/09/24" MemberUntil="12/31/3030">
    <Data id="1" Last="2014/10/05" Amount="20">
    </Data>
  </Member>
  ----------------------------------------------------------If the ID is NOT in the XML, I want it to create a new element under the last element. <Member> NOT <MembershipDetails> With the child "Data".
  <MembershipDetails>
<Membership id="Rare">
</Membership>
  </MembershipDetails>
</AccountManager>

Regards, 
HaHaItsJake
 
Link to post
Share on other sites

Any insight would be helpful. I have tried everything I could think of and came up with a complicated work around for now using the basic Ubot commands. 

Regards, 
HaHaItsJake

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...