hi all,
While i'm sure this is simple, i'm a relative beginner and having trouble with the means to get it done. I'm using Xalan. I have some xml that contains all the information I need within a section of it,
<missingPages></missingPages>, *except* for the URL, which is contained further down
the xml in a list of all pages. I need to grab the page id of a broken link,
for example 1872, find that id in the list of all pages and take the URL attribute out
of that.

Code:
<reports>
...
	<linkIntegrity>
		<missingPages>
			<page pid="1872" >
			<inLinks count="1">
			<link pid="68" text="The broken Link title" line="231" linkCount="1" />
			</inLinks>
			</page>
		</missingPages>
	</linkIntegrity>
	...
	<allPages>
	...
	<page id="1872" url="http://" uri="index.htm" title="this is a page about stuff" pid="1872" crc="737479335" size="12772" />
	...
	</allPages>
</reports>
The shell of how far i've got is below. It can tell that the 2 match, but obviously I need to take the extra
step and pull out the required URL when it does.

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

  <xsl:template match="reports">
    attribute is <xsl:text/>
    <xsl:call-template name="compAttributes">
      <xsl:with-param name="brokenLink" select="/reports/linkIntegrity/missingPages/page/@pid"/>
      <xsl:with-param name="allPagesLink" select="/reports/allPages/page/@pid"/>
    </xsl:call-template>
  </xsl:template>
  
  <xsl:template name="compAttributes">
    <xsl:param name="brokenLink" select="/.."/>
    <xsl:param name="allPagesLink" select="/.."/>

    <xsl:choose>
      <xsl:when test="$brokenLink = $allPagesLink">  
	   <xsl:value-of select="@url"/>
	   SOMEWHERE THEY MATCH
      </xsl:when>
      <xsl:otherwise>0</xsl:otherwise>
    </xsl:choose>
	
  </xsl:template>
</xsl:stylesheet>
any help would be greatly appreciated.

thanks,
Blackwood