Ok, I know (I think) how to select nodes from external Documents using the document() and doc() functions, but I need to know how to search or choose specific nodes based on the content of their attributes and then access the values of attributes in the same node. Here is an example of my problem:
Code:
<folder name="pictures" dirroot="Main\data">
<file name="A01CH-10 Overview.jpg" Section="A01CH-10" Description=" Overview" Path="pictures\A01CH-10 Overview.jpg"/>
<file name="A01CH-20 Overview.jpg" Section="A01CH-20" Description=" Overview" Path="pictures\A01CH-20 Overview.jpg"/>
<file name="A01CH-20 Patching.jpg" Section="A01CH-20" Description=" Patching" Path="pictures\A01CH-20 Patching.jpg"/>
<file name="A01CM-10 Corner Break.jpg" Section="A01CM-10" Description=" Corner Break" Path="pictures\A01CM-10 Corner Break.jpg"/>
<file name="A01CM-10 Overview.jpg" Section="A01CM-10" Description=" Overview" Path="pictures\A01CM-10 Overview.jpg"/>
<file name="A01EM-10 Overview.jpg" Section="A01EM-10" Description=" Overview" Path="pictures\A01EM-10 Overview.jpg"/>
<file name="A01GB-10 Overview.jpg" Section="A01GB-10" Description=" Overview" Path="pictures\A01GB-10 Overview.jpg"/>
<file name="A01GB-20 Overview.jpg" Section="A01GB-20" Description=" Overview" Path="pictures\A01GB-20 Overview.jpg"/>
So I have to access this document as a external document, and then select the name and Description attributes only from those file nodes where the Section attribute = x, where x is combination of two nodes' values in my source document:
Code:
<xsl:copy-of select="DATE"/>
<xsl:copy-of select="SAMPLES"/>
<xsl:copy-of select="BranchID"/>
<xsl:copy-of select="SectionID"/>
<xsl:copy-of select="Surface"/>
<xsl:copy-of select="Condition"/>
Where BranchID and SectionID would concat to equal the Section attribute from the first snippet. For example, if BranchID = "AO1CH" and SectionID = "20", I would need to get the data "A01CH-20 Overview.jpg" and "A01CH-20 Patching.jpg" from the external document. Ideally, it would look like this:
Code:
<pavement_x0020_Branch>
<DATE>2006-04-13T00:00:00</DATE>
<SAMPLES>197</SAMPLES>
<BranchID>A01CH</BranchID>
<SectionID>20</SectionID>
<Surface>PCC</Surface>
<Condition>58</Condition>
<Pictures>
<Picture>A01CH-20 Overview.jpg</Picture>
<Picture>A01CH-20 Patching.jpg</Picture>
</Pictures>
</pavement_x0020_Branch>
My two problems are concating the two node and using the result to search through the external document. I am studying right now how to use keys to search, but am not having much luck. Any help would be great.
Thanks.