Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xsl:template match to two nodes?

Status
Not open for further replies.

VBRookie

Programmer
Joined
May 29, 2001
Messages
331
Location
US

I am sooooo new at this ... please help.

I am returning an xml document from a sql server stored procedure that returns data from more than one table. My resulting xml documentl looks something like this:

<ROOT>
<TABLE1>
...
</TABLE>
<TABLE2>
...
</TABLE2>
</ROOT>

How do I reference this in the match to get data from both? I tried just referencing ROOT but it doesn't quite work right.

This is what I have:

<xsl:template match="//TABLE1|//TABLE2">

Please advise as to what I'm doing wrong ...

Many Thanks,
- VB Rookie
 

Never mind, I thnk I got it (hallelujah!) ...

I ended up doing this:

<xsl:template match="*">

And then when I'm referencing the values I did this

from table one:
<xsl:value-of select="fieldValue"/>

from table two:
<xsl:value-of select="TABLE2/fieldValue"/>

Appears to work fine,

- VB Rookie
 
Status
Not open for further replies.

Similar threads

Part and Inventory Search

Sponsor

Back
Top