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

join xml documents?

I have two xml documents

<?xml version="1.0" standalone="yes"?><CodesFile><CatNumber><number>1</number><code>001</code></CatNumber><CatNumber><number>2</number><code>002</code></CatNumber><CatNumber

an

<?xml version="1.0" standalone="yes"?><NewDataSet><Table><Number_>1</Number_><category_name>Regular </category_name></Table><Table><Number_>2</Number_><category_name>Overtime</category_name></Table><Table></NewDataset

I need to get category_name from doc2 into doc1 as a child just like number and code. If these two documents were tables I would do it like this

select doc1.number, doc2.category_name, doc1.code from doc1 left join doc2 on doc1.number = doc2.number

How would I accomplish this in xml? Would I use XSLT

Thanks

Dann

Nov 12 '05 #1
2 3366
1) load both xml in different xml documents.
2) store the needed nodes in an another xml doc.
3) use function importnode to import nodes from file1 to
file2.

hth.

Sonu
http://weblogs.asp.net/sonukapoor/
-----Original Message-----
I have two xml documents:

<?xml version="1.0" standalone="yes"?
<CodesFile><CatNumber><number>1</number><code>001</code></ CatNumber><CatNumber><number>2</number><code>002</code></Ca
tNumber><CatNumber>
and

<?xml version="1.0" standalone="yes"?
<NewDataSet><Table><Number_>1</Number_><category_name>Regu lar
</category_name></Table><Table><Number_>2</Number_><categor
y_name>Overtime</category_name></Table><Table></NewDataset>
I need to get category_name from doc2 into doc1 as a child just like number and code. If these two documents
were tables I would do it like this:
select doc1.number, doc2.category_name, doc1.code from doc1 left join doc2 on doc1.number = doc2.number_
How would I accomplish this in xml? Would I use XSLT?

Thanks,
Danny

.

Nov 12 '05 #2
1) load both xml in different xml documents.
2) store the needed nodes in an another xml doc.
3) use function importnode to import nodes from file1 to
file2.

hth.

Sonu
http://weblogs.asp.net/sonukapoor/
-----Original Message-----
I have two xml documents:

<?xml version="1.0" standalone="yes"?
<CodesFile><CatNumber><number>1</number><code>001</code></ CatNumber><CatNumber><number>2</number><code>002</code></Ca
tNumber><CatNumber>
and

<?xml version="1.0" standalone="yes"?
<NewDataSet><Table><Number_>1</Number_><category_name>Regu lar
</category_name></Table><Table><Number_>2</Number_><categor
y_name>Overtime</category_name></Table><Table></NewDataset>
I need to get category_name from doc2 into doc1 as a child just like number and code. If these two documents
were tables I would do it like this:
select doc1.number, doc2.category_name, doc1.code from doc1 left join doc2 on doc1.number = doc2.number_
How would I accomplish this in xml? Would I use XSLT?

Thanks,
Danny

.

Nov 12 '05 #3

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

Similar topics

0
by: Danny Acuna | last post by:
I have two xml documents <?xml version="1.0"...
1
by: Steve | last post by:
Hi, I am real new to databases and hoping someone can help. Main-table is a huge spreadsheet that I imported into Access Site-table has a bunch of addresses pulled from Main-table, quite a few...
9
by: deko | last post by:
I need to create a Recordset of all records that appear in one table but do NOT appear in another. To get the records that appear in BOTH tables, I can do this: SELECT tblEntity.Entity_ID...
3
by: Mike Fellows | last post by:
Help, im trying to use a union join from an SQL database and a Access database - the program works fine from my own machine as i have the odbc DSN connections setup from access to link to the...
0
by: Gregory Piñero | last post by:
Would someone mind explaining this seemingly strange behavior of os.path.join to me? >>> os.path.join('C:\\Documents and Settings\\Gregory','\\graphics\\knight\\been hit e0001.bmp')...
1
by: scion111 | last post by:
Is there a way to create a report that documents all of the joins in a database and their type? When looking in the relationships window, all you can see is that a join is one to many etc. What I'd...
52
by: MP | last post by:
Hi trying to begin to learn database using vb6, ado/adox, mdb format, sql (not using access...just mdb format via ado) i need to group the values of multiple fields - get their possible...
9
by: koehlerc14 | last post by:
I'm trying to create a form that imports a text file and join zip code fields to our "Master" database x2. I import the txt file and name it based on a "strTableName" which includes the date, a...
3
by: imtmub | last post by:
Hi, I am trying to link sql table field and excel sheet column. SELECT wko_itemid, imc_qty, ima_price FROM OPENROWSET('Microsoft.Jet.OLEDB.4.0', 'Excel...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
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: 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: 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?
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.