Help needed to make an XSLT for the given XML


XML & Web services: Help needed to make an XSLT for the given XML

  1. Help needed to make an XSLT for the given XML (2 messages)

    Hello everybody.
    It would be great if someone can help...

    I am new to XSLT. I have been given a small task to make an XSLT for the given XML below.
    The output of the XML in IE Browser should look something like this...
    Borrower Name : John Homeowner
    SSN : 234-23-2342
    Date of birth : ... and so on....

    <BORROWER BorrowerID="B300405000" JointAssetBorrowerID="B500222000" _FirstName="John " _LastName="Homeowner " _SSN="300405000" _PrintPositionType="Borrower" JointAssetLiabilityReportingType="Jointly" _UnparsedName="John Homeowner ">
    <_RESIDENCE _StreetAddress="4420 E. Douglas Ave. " _City="Higley " _State="AZ" _PostalCode="85236 " BorrowerResidencyType="Current"/>
    <CURRENT_INCOME IncomeType="Base" _MonthlyTotalAmount="4100.00"/>
    <CURRENT_INCOME IncomeType="MilitaryBasePay" _MonthlyTotalAmount="250.00"/>
    <DECLARATION BankruptcyIndicator="N" CitizenshipResidencyType="USCitizen" HomeownerPastThreeYearsType="No" IntentToOccupyType="Yes"/>
    <EMPLOYER CurrentEmploymentMonthsOnJob="0 " CurrentEmploymentYearsOnJob="1 " EmploymentBorrowerSelfEmployedIndicator="Y" EmploymentCurrentIndicator="Y" EmploymentPrimaryIndicator="Y"/>
    <GOVERNMENT_MONITORING RaceNationalOriginRefusalIndicator="N">
    <PRESENT_HOUSING_EXPENSE HousingExpenseType="Rent" _PaymentAmount="892.00"/>
    <PRESENT_HOUSING_EXPENSE HousingExpenseType="FirstMortgagePrincipalAndInterest"/>

    Threaded Messages (2)

  2. The following is enough to show the full name of the borrower:

    <?xml version="1.0" encoding="UTF-8"?>
    <xsl:stylesheet version="1.0" xmlns:xsl="" >

    <xsl:template match="/">
      <h1>Loan application</h1>
      <xsl:apply-templates select="*"/>

    <xsl:template match="LOAN_APPLICATION">
      <table border="1">
        <xsl:apply-templates select="*"/>

    <xsl:template match="BORROWER">
      <th>Borrower name:</th>
      <td><xsl:value-of select="@_FirstName"/> <xsl:value-of select="@_LastName"/></td>


    Other data can be output in a similar way.

    I am not sure whether asking so basic and generic questions is actually a good thing. I advise you to read materials like, which was good, although I reckon it is getting obsolete by now.

  3. Thanks[ Go to top ]

    Thanks Javier
    I am very new to XSL and XML.. Since that was my first day, I thought of getting a quick answer hence posted the question. I worked out the solution myself using XSLT long back and realised, XSL is not as powerful tool as any other language like Java. So have decided to go J2EE way.

    I am sure this link will be helpful for even new bies like me.