XSL help

Discussion in 'XML' started by poisontheused, Aug 16, 2004.

  1. I'm attempting to display the following XML code in an HTML table usin
    an XSL stylesheet. but am having a few problems.

    First off an extract from the XML which was generated using Crysta
    Reports


    Code
    -------------------

    <FormattedSections>
    <FormattedSection SectionNumber="0">
    <FormattedReportObjects>
    <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{VhStock.REGNO}"><ObjectName>Field22</ObjectName>
    <FormattedValue>RLF462</FormattedValue>
    <Value>RLF462</Value>
    </FormattedReportObject>
    <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{VhStock.BODY_TYPE}"><ObjectName>Field25</ObjectName>
    <FormattedValue>SEDAN</FormattedValue>
    <Value>SEDAN</Value>
    </FormattedReportObject>
    <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{VhStock.TRANSMISSION}"><ObjectName>Field27</ObjectName>
    <FormattedValue>5M</FormattedValue>
    <Value>5M</Value>
    </FormattedReportObject>
    <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{VhStock.PAINT}"><ObjectName>Field28</ObjectName>
    <FormattedValue>GREEN</FormattedValue>
    <Value>GREEN</Value>

    -------------------

    **Note i am wanting to diplay the data between the<Value> </Value> tag
    in the above XML. How do i select Say just the "VhStock.REGNO" field t
    display in one <td> and "VhStock.Paint" in the next <td>.

    Heres the stylesheet i've created to display the XML it grabs the dat
    but doesnt put it in to a table or any sort of structure plese help:


    Code
    -------------------

    <?xml version="1.0" encoding="ISO-8859-1"?>
    <!-- Edited with XML Spy v4.2 -->
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">

    <xsl:template match="/">
    <html>
    <body>
    <h2>Used Vehicles</h2>
    <xsl:apply-templates/>
    </body>
    </html>
    </xsl:template>

    <xsl:template match="FormattedReportObjects">
    <table border="0">
    <xsl:apply-templates/>
    </table>
    </xsl:template>

    <xsl:template match="FormattedReportObject">
    <tr>
    <xsl:apply-templates/>
    </tr>
    </xsl:template>

    <xsl:template match="ObjectName|FormattedValue|Value">
    <td>
    <xsl:value-of select="text()"/>
    </td>
    </xsl:template>
    </xsl:stylesheet>

    -------------------

    when i view this in the browser it displays like this.
    --------------------------------------------------------------------------
    Used Vehicles
    Field26DAEWOODAEWOOField22RLF462RLF462Field25SEDANSEDANField275M5MField28GREENGREENField2906/981998-06-01T00:00:00Field304/02/052005-02-04T00:00:00Field3187,13687136.00Field33BBField34269269.00Field1$7,9957995.00Field2110110.00Field5LA
    OS SELANOS
    --------------------------------------------------------------------------
    So its not displaying it in a table at all.. i have tried followin
    many tutorials but none have helped me so far.

    I have checked both the XML and XSL file in an editor and are bot
    well-formed.

    I'm just really stuck on this at the moment, mainly because none of th
    tutorials really relate to an XML document structured like the on
    above.

    Any help would be greatly appreciated


    -
    poisontheuse
    -----------------------------------------------------------------------
    Posted via http://www.forum4designers.co
    -----------------------------------------------------------------------
    View this thread: http://www.forum4designers.com/message108181.htm
    poisontheused, Aug 16, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Kevin Flood
    Replies:
    0
    Views:
    1,017
    Kevin Flood
    Sep 8, 2004
  2. Kevin Flood
    Replies:
    1
    Views:
    2,729
    Kevin Flood
    Sep 13, 2004
  3. Klaus Friese
    Replies:
    0
    Views:
    466
    Klaus Friese
    Nov 22, 2004
  4. Replies:
    1
    Views:
    3,598
    A. Bolmarcich
    May 27, 2005
  5. =?iso-8859-1?q?Jean-Fran=E7ois_Michaud?=

    Help with XSL/XSL:FO for producing revision indicator bar in document.

    =?iso-8859-1?q?Jean-Fran=E7ois_Michaud?=, Apr 28, 2006, in forum: XML
    Replies:
    6
    Views:
    572
    =?iso-8859-1?q?Jean-Fran=E7ois_Michaud?=
    May 3, 2006
Loading...

Share This Page