473,378 Members | 1,549 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Help copying values from one node to another

Hi,
i have two xml nodes
<values>
<value/>
<description/>
<checked>
</values>

and second one
<names>
<name/>
<namedesc/>
</names>

I am trying to copy the value and description values from nodevalues into names node, but with no luck, here is what I have so far,Any help will be greatly appreciated.

for(iCtr=0;iCtr<=NodeList.length - 1;iCtr++)
{
NodeList.item(0).selectSingleNode('value').text
xmlNodeNames.selectSingleNode("//names/name['iCtr']").text=xmlNode.selectSingleNode('value').text ;

}
Aug 14 '07 #1
3 1381
jkmyoung
2,057 Expert 2GB
xmlNodeNames.selectSingleNode("//names/name["+iCtr+"]").text=xmlNode.selectSingleNode('value').text ;
Aug 14 '07 #2
xmlNodeNames.selectSingleNode("//names/name["+iCtr+"]").text=xmlNode.selectSingleNode('value').text ;

Thanks for your reply.it did work the first time that is when iCtr=0, but the second time thru the loop, gave me an object error.
Any insight into this will be greatly appreciated.
Aug 15 '07 #3
jkmyoung
2,057 Expert 2GB
Then you only have at most one //names/name node.
How are you creating the variable NodeList, from the value nodes?

Do you need to add more name nodes?

I'm actually surprised it worked when iCtr = 0, as xPath is supposed to begin counting from 1. I would think you'd need (iCtr + 1).
Aug 15 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

23
by: Francis Avila | last post by:
Below is an implementation a 'flattening' recursive generator (take a nested iterator and remove all its nesting). Is this possibly general and useful enough to be included in itertools? (I know...
2
by: Mirjana Rakuljic | last post by:
Hi, I need help with transforming XML document. I generate xml document from query using Oracle XSU (DBMS_XMLQUERY) and the document I get is like this: <?xml version = '1.0' encoding =...
21
by: Matteo Settenvini | last post by:
Ok, I'm quite a newbie, so this question may appear silly. I'm using g++ 3.3.x. I had been taught that an array isn't a lot different from a pointer (in fact you can use the pointer arithmetics to...
5
by: jhon02148 | last post by:
hi this hw have four files: 1. for the main program 2. listp.cpp (the source file) 3. listp.h (the header file) 4. exception.h if there is anybody who could help me with this hw i really...
1
by: jhon02148 | last post by:
hi this hw have four files: 1. for the main program 2. listp.cpp (the source file) 3. listp.h (the header file) 4. exception.h hi iam done with my hw i still have to do one function which is...
2
by: David Elliott | last post by:
I am creating a configuration class to read / write a standard configuration file. <?xml version="1.0" encoding="utf-8"?> <configuration> <appSettings> <add key="ConnectionString"...
5
by: jimjim | last post by:
Hello, Any help will be much appreciatted. My problem is as follows: I declare as global variables: typedef struct _Node{ ..; ..;}Node; Node *Graph; in a function called initiallise(), I...
2
by: XML Beginner | last post by:
I have an XML file that contains values that my application needs, so it knows which database to connect to. It also contains a configuration option so that I can specify which node to return...
1
by: lharenyam | last post by:
Hi, I nedd help copying values form one node to another Help copying values from one node to another -------------------------------------------------------------------------------- Hi, i...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.