Link to home
Start Free TrialLog in
Avatar of Larry Brister
Larry BristerFlag for United States of America

asked on

XSLT Output with header...

I'm extremly new to xslt

Recieved excellent code at bottom from zc2.

How can I apply this Template ABOVE the bottom section?

DESIRED AT THE TOP...
   <xsl:template match="header">
        <xsl:value-of select="Client"/>
        <xsl:apply-templates select="Classification"/> --Sure this is wrong...
    </xsl:template>


THIS EXISTS and POPULATES  CORRECTLY
<xsl:output method="html" indent="yes" encoding="iso-8859-1"/>
        <xsl:key name="cl" match="Classification" use="@Name" />

        <xsl:template match="*[Classification]">
            <xsl:apply-templates select="Classification[generate-id(.) = generate-id( key('cl', @Name))]"/>
        </xsl:template>

        <xsl:template match="Classification">
            <div>
                Classification: <xsl:value-of select="@Name"/>
            </div>
            <xsl:for-each select="key('cl', @Name)">
                <div style="margin-left: 1em;">
                    Rule:<xsl:value-of select="@Rule"/>
                </div>
                <xsl:apply-templates select="ruleDetailRecord"/>
            </xsl:for-each>
        </xsl:template>

        <xsl:template match="ruleDetailRecord">
            <div style="margin-left: 2em;">
                <table cellpadding="0" cellspacing="0" border="0">
                    <tr>
                        <td>
                            <xsl:value-of select="@DocDisplay"/>
                        </td>
                        <td>
                            <xsl:value-of select="@RuleSatisfactory"/>
                        </td>
                        <td>
                            <xsl:value-of select="@ReqSatisfactory"/>
                        </td>
                    </tr>
                </table>
            </div>
        </xsl:template>
Avatar of zc2
zc2
Flag of United States of America image

Can you please provide a bigger chunk of your XML? I need to see what's the parent elements of the Classification nodes to give you a suitable answer.
Avatar of Larry Brister

ASKER

Here are the fullnodes below
I want below the <header> and above the first <Classification> in a top template section...Assignment Number etc...

Experienced vb programmer...VERY newbie at XSLT

<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="DevDocValid.xslt"?>
<Document>
    <header>
        <AssignmentNumber>11327</AssignmentNumber>
        <Status>Working</Status>
        <FirstName>Myra</FirstName>
        <LastName>Stansfield</LastName>
        <email>mstans7711@aol.com</email>
        <Client>St. Clare's Hospital - Denville</Client>
        <StartDate>2012-04-30T00:00:00</StartDate>
        <ST>NJ</ST>
        <Classification Name="Certification" Rule="None">
            <ruleDetailRecord DocDisplay="ACLS" RuleSatisfactory="0" ReqSatisfactory="1" />
            <ruleDetailRecord DocDisplay="CPR" RuleSatisfactory="0" ReqSatisfactory="1" />
            <ruleDetailRecord DocDisplay="Fetal Monitoring" RuleSatisfactory="0" ReqSatisfactory="1" />
            <ruleDetailRecord DocDisplay="NRP" RuleSatisfactory="0" ReqSatisfactory="1" />
            <ruleDetailRecord DocDisplay="RN License" RuleSatisfactory="0" ReqSatisfactory="1" />
        </Classification>
        <Classification Name="Client Doc" Rule="None">
            <ruleDetailRecord DocDisplay="NJHA Background Check Form" RuleSatisfactory="0" ReqSatisfactory="0" />
            <ruleDetailRecord DocDisplay="NJHA Confidentiality Form" RuleSatisfactory="0" ReqSatisfactory="0" />
            <ruleDetailRecord DocDisplay="NJHA-MCSS IV Certification Form" RuleSatisfactory="0" ReqSatisfactory="0" />
            <ruleDetailRecord DocDisplay="St. Clare Confidentiality-NJHA" RuleSatisfactory="0" ReqSatisfactory="0" />
            <ruleDetailRecord DocDisplay="St. Clare LEARN Info-NJHA" RuleSatisfactory="0" ReqSatisfactory="1" />
            <ruleDetailRecord DocDisplay="St. Clare Values and Ethics-NJHA" RuleSatisfactory="0" ReqSatisfactory="0" />
        </Classification>
        <Classification Name="Client Doc" Rule="PPD or Chest X-Ray for NJHA">
            <ruleDetailRecord DocDisplay="NJHA TB Questionnaire Signed By Physician" RuleSatisfactory="0" ReqSatisfactory="0" />
        </Classification>
        <Classification Name="Exam" Rule="None">
            <ruleDetailRecord DocDisplay="LD Exam" RuleSatisfactory="0" ReqSatisfactory="1" />
            <ruleDetailRecord DocDisplay="Pharmacology online exam" RuleSatisfactory="0" ReqSatisfactory="1" />
            <ruleDetailRecord DocDisplay="St. Clare NJHA Code Exam" RuleSatisfactory="0" ReqSatisfactory="1" />
        </Classification>
        <Classification Name="Health Doc" Rule="None">
            <ruleDetailRecord DocDisplay="Color Blind Test" RuleSatisfactory="0" ReqSatisfactory="1" />
            <ruleDetailRecord DocDisplay="Physical" RuleSatisfactory="0" ReqSatisfactory="1" />
            <ruleDetailRecord DocDisplay="Varicella Titer" RuleSatisfactory="0" ReqSatisfactory="1" />
        </Classification>
        <Classification Name="Health Doc" Rule="Hep B Titer or Immunization">
            <ruleDetailRecord DocDisplay="Hep B Immunization 3 vaccines" RuleSatisfactory="0" ReqSatisfactory="0" />
            <ruleDetailRecord DocDisplay="Hep B TITER" RuleSatisfactory="0" ReqSatisfactory="0" />
            <ruleDetailRecord DocDisplay="Hep B titer with antibody and antigen" RuleSatisfactory="0" ReqSatisfactory="0" />
        </Classification>
        <Classification Name="Health Doc" Rule="MMR Titers Only (R+R+M)">
            <ruleDetailRecord DocDisplay="Mumps Titer" RuleSatisfactory="1" ReqSatisfactory="1" />
            <ruleDetailRecord DocDisplay="Rubella Titer" RuleSatisfactory="1" ReqSatisfactory="1" />
            <ruleDetailRecord DocDisplay="Rubeola Titer" RuleSatisfactory="1" ReqSatisfactory="1" />
        </Classification>
        <Classification Name="Health Doc" Rule="PPD or Chest X-Ray for NJHA">
            <ruleDetailRecord DocDisplay="2nd PPD Statement" RuleSatisfactory="0" ReqSatisfactory="0" />
            <ruleDetailRecord DocDisplay="Chest Xray in place of PPD" RuleSatisfactory="0" ReqSatisfactory="1" />
            <ruleDetailRecord DocDisplay="PPD Statement" RuleSatisfactory="0" ReqSatisfactory="0" />
        </Classification>
        <Classification Name="Nightingale" Rule="None">
            <ruleDetailRecord DocDisplay="2nd References" RuleSatisfactory="0" ReqSatisfactory="0" />
            <ruleDetailRecord DocDisplay="401 K" RuleSatisfactory="0" ReqSatisfactory="1" />
            <ruleDetailRecord DocDisplay="Core Competencies" RuleSatisfactory="0" ReqSatisfactory="1" />
            <ruleDetailRecord DocDisplay="Criminal Check Drug Screen Consent" RuleSatisfactory="0" ReqSatisfactory="1" />
            <ruleDetailRecord DocDisplay="Direct Deposit Form" RuleSatisfactory="0" ReqSatisfactory="1" />
            <ruleDetailRecord DocDisplay="Drug Result" RuleSatisfactory="0" ReqSatisfactory="1" />
            <ruleDetailRecord DocDisplay="Employment Agreement" RuleSatisfactory="0" ReqSatisfactory="1" />
            <ruleDetailRecord DocDisplay="Employment Application" RuleSatisfactory="0" ReqSatisfactory="1" />
            <ruleDetailRecord DocDisplay="Hepatitis B Declination Form" RuleSatisfactory="0" ReqSatisfactory="1" />
            <ruleDetailRecord DocDisplay="HIPAA Compliance Statement" RuleSatisfactory="0" ReqSatisfactory="1" />
            <ruleDetailRecord DocDisplay="I-9 Form" RuleSatisfactory="0" ReqSatisfactory="1" />
            <ruleDetailRecord DocDisplay="NJ Tax Form" RuleSatisfactory="0" ReqSatisfactory="0" />
            <ruleDetailRecord DocDisplay="Payroll Process Form" RuleSatisfactory="0" ReqSatisfactory="1" />
            <ruleDetailRecord DocDisplay="Permanent Tax Home Notification Form" RuleSatisfactory="0" ReqSatisfactory="1" />
            <ruleDetailRecord DocDisplay="References" RuleSatisfactory="0" ReqSatisfactory="0" />
            <ruleDetailRecord DocDisplay="Self Health Assessment" RuleSatisfactory="0" ReqSatisfactory="1" />
            <ruleDetailRecord DocDisplay="Skills Checklist within one year" RuleSatisfactory="0" ReqSatisfactory="1" />
            <ruleDetailRecord DocDisplay="W-4" RuleSatisfactory="0" ReqSatisfactory="1" />
        </Classification>
        <Classification Name="Nightingale" Rule="I-9 Documentation">
            <ruleDetailRecord DocDisplay="I-9 Documentation List A" RuleSatisfactory="1" ReqSatisfactory="1" />
            <ruleDetailRecord DocDisplay="I-9 Documentation List B" RuleSatisfactory="1" ReqSatisfactory="1" />
            <ruleDetailRecord DocDisplay="I-9 Documentation List C" RuleSatisfactory="1" ReqSatisfactory="1" />
        </Classification>
        <Classification Name="Nightingale" Rule="Insurance Application">
            <ruleDetailRecord DocDisplay="Insurance Application" RuleSatisfactory="1" ReqSatisfactory="1" />
            <ruleDetailRecord DocDisplay="Insurance Refusal" RuleSatisfactory="1" ReqSatisfactory="1" />
        </Classification>
        <Classification Name="Nightingale Internal" Rule="None">
            <ruleDetailRecord DocDisplay="Background Check" RuleSatisfactory="0" ReqSatisfactory="1" />
            <ruleDetailRecord DocDisplay="EPLS" RuleSatisfactory="0" ReqSatisfactory="1" />
            <ruleDetailRecord DocDisplay="OIG" RuleSatisfactory="0" ReqSatisfactory="1" />
            <ruleDetailRecord DocDisplay="Sex Offender" RuleSatisfactory="0" ReqSatisfactory="0" />
            <ruleDetailRecord DocDisplay="Social Security Trace" RuleSatisfactory="0" ReqSatisfactory="1" />
        </Classification>
    </header>
</Document>
ASKER CERTIFIED SOLUTION
Avatar of zc2
zc2
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Oh man!  Thanks!
Anything you ever need...
Mayhem, assault, robbery...just let me know!

remind me to buy you a sody-pop sometime too
You're welcome