[xsl] Another complex condition

Subject: [xsl] Another complex condition
From: "Bradley, Peter" <pbradley@xxxxxxxxxx>
Date: Wed, 1 Oct 2008 16:02:06 +0100
I am trying to satisfy another condition, but am having some difficulty.
HESA themselves (in their validation kit) appear to check this:

<xsl:if test="(SCN) and Instance[COURSEID =
../../Course[contains('HIJCPQRS', substring(COURSEAIM, 1,
1))]/COURSEID]/EntryProfile[UCASAPPID]/DOMICILE[.='XH']">

  <!-- Do Stuff -->

</xsl:if>

Given the map of the document complex types:

HesaSqlExplicit_Response
  |
  |
  +-- Institution (0:1)
        |
        |
        +-- Student (1:unbounded)
        |      |
        |      |
        |      +-- Instance (1:unbounded)
        |             |
        |             |
        |             +-- EntryProfile (0:1)
        |
        +-- Module (1:unbounded)
        |
        |
        +-- Course (1:unbounded)

Could someone explain what is actually being tested here?  There is a
COURSEID element in both Course and Instance

HESAs own explanation is:

"Student.SCN must exist where (EntryProfile.DOMICILE exists and is coded
XH) and EntryProfile.UCASAPPID exists and Course.COURSEAIM begins H, I,
J, C, P, Q, R or S"

Given that a Student can have many Instances and that EntryProfile is a
child of Instance I don't see how the test can be done.  How do we know
which of the students Instances to use for checking the COURSEID and for
the EntryProfile.DOMICILE?

I know that you cannot answer that last question.  I am just trying to
find out if HESAs own test answers it either implicitly or explicitly
and I am too dense to see it.

Thanks (again)


Peter

Current Thread