473,387 Members | 1,834 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,387 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 3367
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...
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: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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...
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
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,...
0
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...

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.