473,396 Members | 1,995 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,396 software developers and data experts.

Copy node values from one xml to the other (tags are removed!)

KK
Hi,

I have file1 that looks like this;

<A>
<user_id><xsl:value-of-select=\"A/user_id\"/></user_id>
<context>something</context>
</A>

Another file with the exist (File2)
<A>
<user_id>DATAMGR</user_id>
<user_name>DATAMGR</user_name>
</A>

After the transformation, I want File1, to look up value of <user_id/in
File2 so the File1 and ends up with the xml;

<A>
<user_id>DATAMGR</user_id>
<context>something</context>
</A>

I am not sure how the xslt should look like. the one I used was;

<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">

<xsl:template match="self">
<xsl:copy>
<A>
<user_id><xsl:value-of-select=\"A/user_id\"/></user_id>
<context>something</context>
</A>
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>

I am new to xslt and from what I saw by browsing the net is that, I am doing
something wrong in applying the template. Seems like it uses the default
template so it gives out only the values, not the xml nodes.

Thanks for any help.

Regards
KK
Nov 7 '07 #1
0 2071

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Mike McCarthy | last post by:
I have the following XML.. <?xml version="1.0" encoding="UTF-8"?> <EMS> <Scene> <Number_of_Patients>1212</Number_of_Patients>
3
by: M | last post by:
I am trying to copy the values of one hashtable to another. I ran into a read only error when using the IDictionaryEnumerator. while (myHashEnumerator.MoveNext()){ while...
1
by: Joep | last post by:
Hi, In VB.net I have an array which contains different values. For example: array(0) = 2 array(1) = 2 array(2) = 2 array(3) = 3 array(4) = 3 array(5) = 6 array(6) = 6
4
by: Keith Patrick | last post by:
I'm trying to parse some XML via IXPathNavigable, handling elements, text, and attributes with the same code but without having a switch (node.NodeType). However, if I look at a parent element in...
6
by: Cliff72 | last post by:
I need to fill in the nulls in the batch field the value from the record immediately preceding the null one ie replace the nulls with the preceding value until I hit a record with a value in...
3
by: srinivasreddypn | last post by:
Hi everybody, Here I am doing a project to generate flash line graphs using xml data. I prepared every thing ready for this, But only problem I am facing since so many days is from the node values...
0
by: Kavitha Sudhershan | last post by:
hi, i wanna read the node values from xml. As per my code i can read the node values in first child node and for the next node am not able to read the node values. pls help me. i'll paste the code...
7
by: himanshupancholi | last post by:
Hi, I need to Copy all values of a column from one table to another. Below are the details: Source: STL_GRP table, VEND column Destination PARTNER table, VEND column. I am using the below...
2
by: westoneman | last post by:
When i set the contents of mydiv with a html formatted string document.getElementById("mydiv").innerHTML=xmlHttp4.responseText; it displays the data without the html formatting tags. my...
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: 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
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
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...
0
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...

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.