473,513 Members | 2,575 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Inserting Nodes between Nodes

162 New Member
Hi,

XML novice here with another question. I need to add a XML node like,

Expand|Select|Wrap|Line Numbers
  1.     <child01>
  2.         <child02>
  3.             <text></text>
  4.             <image>image 1</image>
  5.             <image>image 2</image>
  6.         </child02>
  7.     </child01>
  8.  
into this node between the ending </child01> and beginning <child01> of the


Expand|Select|Wrap|Line Numbers
  1.     <child01>
  2.         <child02>
  3.             <text></text>
  4.             <image>image 1</image>
  5.             <image>image 2</image>
  6.         </child02>
  7.     </child01>    
  8.     <child01>
  9.         <child02>
  10.             <text></text>
  11.             <image>image 1</image>
  12.             <image>image 2</image>
  13.         </child02>
  14.     </child01>
  15.  
Does this make sense? I guess im looking for a way to say/do... make a new node with the following values and place it between these other two nodes.

I still am learning XML but i think this can be done.
Jan 21 '08 #1
2 1169
empiresolutions
162 New Member
woops sorry, my 2nd XML is wrong. here is the correct.

Expand|Select|Wrap|Line Numbers
  1. <child01>
  2.     <child02>
  3.         <text></text>
  4.         <image>image 1</image>
  5.         <image>image 2</image>
  6.     </child02>
  7.     <child02>
  8.         <text></text>
  9.         <image>image 1</image>
  10.         <image>image 2</image>
  11.     </child02>
  12. </child01>
  13. <child01>
  14.     <child02>
  15.         <text></text>
  16.         <image>image 1</image>
  17.         <image>image 2</image>
  18.     </child02>
  19.     <child02>
  20.         <text></text>
  21.         <image>image 1</image>
  22.         <image>image 2</image>
  23.     </child02>
  24. </child01>
  25.  
Jan 21 '08 #2
empiresolutions
162 New Member
one other thing... i want to do this in PHP if possible, but other languages are ok.
Jan 21 '08 #3

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

Similar topics

2
2054
by: Lutz Ißler | last post by:
Hi all! I dymically replace the child nodes of a DIV element by image nodes. In IE and Firefox this works properly. In Safari it works properly, too - but only if the site is called locally, eg. with file://. Uploading to a server and viewing the site in Safari with http:// results in an error. The problematic code is the following: ...
6
2709
by: DWrek | last post by:
Here is my problem. I have an XML document that is returned to me by a third party service. The XML document contains results for a search but only lists a maximum of 10 results. If there are any further results then the XML document contains a URL to call and get the next set of 10 results. So if there were 25 results total I would get the...
2
4097
by: daz_oldham | last post by:
Hi Everyone I have an xml document, and for the purposes of my application, I am going to take a node of the xml (child), add a child to it and then store it into the database for later use. So I start with: <doc xmlns:"http://www.xml.com"> <stuff>
6
2601
by: serge calderara | last post by:
Dear all, I was wondering is there is a way to customise the treView control in order to get any Control as a Node. What I try to do is having a Progress bar as a treeview node object. Is that possible ? regards serge
4
6193
by: javascript | last post by:
I am wondering if it is possible to create a JavaScript function that will re-order child nodes in an Xml Document. Currently I am binding an Xml Data Island to an HTML table and implemented drag-and-drop functionality. Let's say I have the following: Sequence 1 - 1 - 2
4
3007
by: reflex | last post by:
I have to get every node within range or selection? Is it possible? Sry for my engrish :] Ref
20
16600
by: alice | last post by:
I'm doing some text swapping with javascript, got it working fine, but I would like the line to have line breaks and being a beginner, I don't even know if this is possible. So I have a line like this swaptext('Shaun, Greg, Violet, Joel, 1999')"; and I would like 1999 to be on a new line. Is there a simple way to do this? I'd swear I've seen...
7
15233
by: MaxMax | last post by:
I want to insert a white line between XML elements to raise human readability example: <MyNode> </MyNode> <MyNode> </MyNode>
2
1949
by: SMH | last post by:
I am in the process of converting all HTML documents, including many dynamic/interactive documents, to XHTML documents (because I want to incorporate SVG and MathML, among other things). I am having a problem converting document.write() statements which are not allowed in XHTML documents to statements which create the DOM...
4
1944
by: MRe | last post by:
Hi, Is it possible using XSLT to transform this.. <test> <b>0</b> <a>1</a> <a>2</a> <b>3</b> <b>4</b>
0
7178
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7397
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
7565
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7128
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7543
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
0
5704
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then...
0
3242
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1612
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
817
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.