table joins--how to???
-
Hi, I'm new to all this XML stuff, and I'm trying to figure out how I can code a table join like you can in SQL. Is this even possible with XML? I've got an XML file with 2 tables, and I'd like to perform a query where table1.id = table2.t1_id, for example. I've looked into XPath, and it doesn't seem like it can do the trick. Thanks! Marc Help! I'm an AI running around in someone's f*cked up universe simulator.
-
Hi, I'm new to all this XML stuff, and I'm trying to figure out how I can code a table join like you can in SQL. Is this even possible with XML? I've got an XML file with 2 tables, and I'd like to perform a query where table1.id = table2.t1_id, for example. I've looked into XPath, and it doesn't seem like it can do the trick. Thanks! Marc Help! I'm an AI running around in someone's f*cked up universe simulator.
Depends on what you are looking for. Using a transformation xslt and using the XPath select in which you match the child element (or attribute) value, in the select statement, can give you the relation. I.E. select table 1 first and then for each child entity run a select of table 2 with the value from table 1 as part of the select statement. If you just want to use some of the values of the initial element (table 1) you can pass those values with the param usage and then only perform the output in the second template.
-
Hi, I'm new to all this XML stuff, and I'm trying to figure out how I can code a table join like you can in SQL. Is this even possible with XML? I've got an XML file with 2 tables, and I'd like to perform a query where table1.id = table2.t1_id, for example. I've looked into XPath, and it doesn't seem like it can do the trick. Thanks! Marc Help! I'm an AI running around in someone's f*cked up universe simulator.
-
Yes! Thank you very much. I see that Microsoft has a managed source demo of XQuery. Looks like it might be the makings of an interesting article. Thanks again! Marc Help! I'm an AI running around in someone's f*cked up universe simulator.
-
Hi, I'm new to all this XML stuff, and I'm trying to figure out how I can code a table join like you can in SQL. Is this even possible with XML? I've got an XML file with 2 tables, and I'd like to perform a query where table1.id = table2.t1_id, for example. I've looked into XPath, and it doesn't seem like it can do the trick. Thanks! Marc Help! I'm an AI running around in someone's f*cked up universe simulator.
<xsl:template match="//table2[table1/@id = @id]"> ... </xsl:template>
"When the only tool you have is a hammer, a sore thumb you will have."
-
<xsl:template match="//table2[table1/@id = @id]"> ... </xsl:template>
"When the only tool you have is a hammer, a sore thumb you will have."
Ah ha. I've been reading up on XQuery vs. XSL, and I find it quite interesting (and quite obtuse). Thanks for this tidbit! Marc Help! I'm an AI running around in someone's f*cked up universe simulator.