Craig is working to develop an XSLT application to display election results, using XML files with the structures shown in the accompanying figure. He has heard that you have experience developing applications, and comes to you for guidance.
-Craig would like to be able to use data from both documents in his application. You suggest he create variables that will allow him to pull the node sets from both files. Which of the following shows the correct syntax to create a variable named candidatesDoc to reference the root node of the candidates.xml file?
A) <xsl:variable name="candidatesDoc" match="document() 'candidates.xml') " />
B) <xsl:variable name="candidatesDoc" select="doc('candidates.xml') " />
C) <xsl:variable name="candidatesDoc" match="doc('candidates.xml') " />
D) <xsl:variable name="candidatesDoc" select="document() 'candidates.xml') " />
Correct Answer:
Verified