XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old August 12th, 2004, 09:41 PM
poisontheused poisontheused is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 13 poisontheused User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 52 m 56 sec
Reputation Power: 0
Question How to process this XML file in HTML

I've been supplied with the following XML file and am wanting to display the data in a HTML table. The XML file has been generated by Crystal Reports. Previously i've beeen able to call XML(more basic looking XML files) into HTML using the <span datafld="____"></span> command.. But i've tried it with this particular XML file and no luck at all. I've tried putting everything in the "datafld" area and no luck. Could someone please provide info on how to call data from the following file into a HTML table. Any help would be greatly apreciated. Thanks for your time

Heres an extract of my XML file

<?xml version="1.0" encoding="UTF-8" ?>
<FormattedReport xmlns = 'urn:crystal-reports:schemas' xmlns:xsi = 'http://www.w3.org/2000/10/XMLSchema-instance'>
<FormattedAreaPair Level="0" Type="Report">
<FormattedAreaPair Level="1" Type="Group">
<FormattedArea Type="Header">
<FormattedSections>
<FormattedSection SectionNumber="0">
<FormattedReportObjects>
<FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="GroupName ({VhStock.MAKE})"><ObjectName>Field26</ObjectName>
<FormattedValue>DAEWOO</FormattedValue>
<Value>DAEWOO</Value>
</FormattedReportObject>
</FormattedReportObjects>
</FormattedSection>
</FormattedSections>
</FormattedArea>
<FormattedAreaPair Level="2" Type="Group">
<FormattedAreaPair Level="3" Type="Details">
<FormattedArea Type="Details">
<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>
</FormattedReportObject>
<FormattedReportObject xsi:type="CTFormattedField" Type="xsd:timeInstant" FieldName="{VhStock.compliance_date}"><ObjectName>Field29</ObjectName>
<FormattedValue>06/98</FormattedValue>
<Value>1998-06-01T00:00:00</Value>
</FormattedReportObject>
<FormattedReportObject xsi:type="CTFormattedField" Type="xsd:timeInstant" FieldName="{VhStock.REGEXP}"><ObjectName>Field30</ObjectName>
<FormattedValue>4/02/05</FormattedValue>
<Value>2005-02-04T00:00:00</Value>
</FormattedReportObject>
<FormattedReportObject xsi:type="CTFormattedField" Type="xsd:decimal" FieldName="{VhStock.ODOMETER}"><ObjectName>Field31</ObjectName>
<FormattedValue>87,136</FormattedValue>
<Value>87136.00</Value>
</FormattedReportObject>
<FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{VhStock.BR}"><ObjectName>Field33</ObjectName>
<FormattedValue>B</FormattedValue>
<Value>B</Value>
</FormattedReportObject>
<FormattedReportObject xsi:type="CTFormattedField" Type="xsd:decimal" FieldName="{@DIS}"><ObjectName>Field34</ObjectName>
<FormattedValue>269</FormattedValue>
<Value>269.00</Value>
</FormattedReportObject>
<FormattedReportObject xsi:type="CTFormattedField" Type="xsd:decimal" FieldName="{VhStock.veh_sale_price_inc_gst}"><ObjectName>Field1</ObjectName>
<FormattedValue>$7,995</FormattedValue>
<Value>7995.00</Value>
</FormattedReportObject>
<FormattedReportObject xsi:type="CTFormattedField" Type="xsd:long" FieldName="{VhStock.NO}"><ObjectName>Field2</ObjectName>
<FormattedValue>110</FormattedValue>
<Value>110.00</Value>
</FormattedReportObject>
<FormattedReportObject xsi:type="CTFormattedField" FieldName="{@Model & Level}" Type="xsd:string"><ObjectName>Field5</ObjectName>
<FormattedValue>LANOS SE</FormattedValue>
<Value>LANOS SE</Value>
</FormattedReportObject>
<FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{VhStock.MODEL}"><ObjectName>Field6</ObjectName>
<FormattedValue>D4L</FormattedValue>
<Value>D4L</Value>
</FormattedReportObject>
<FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{VhStock.note}"><ObjectName>Field3</ObjectName>
<FormattedValue>ONE LOCAL OWNER, FULL SERVICE HISTORY, AIR CONDITIONING,
POWER STEERING.</FormattedValue>
<Value>ONE LOCAL OWNER, FULL SERVICE HISTORY, AIR CONDITIONING,
POWER STEERING.</Value>
</FormattedReportObject>
</FormattedReportObjects>
</FormattedSection>
</FormattedSections>
</FormattedArea>
</FormattedAreaPair>
</FormattedAreaPair>
</FormattedAreaPair>

Reply With Quote
  #2  
Old August 13th, 2004, 04:48 AM
kid23 kid23 is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 62 kid23 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 5
I won't do the whole stuff, but with three xsl templates, you can already take care of the html table (i'll leave the rest up to you):

Code:
<xsl:template match="FormattedReportObjects">
  <table brder="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>


This will take care of the data that you have to put into a table, for the rest, find some xsl tutorial around (w3schools), and built the page around it.

Hope this helps

Reply With Quote
  #3  
Old August 13th, 2004, 10:24 PM
poisontheused poisontheused is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 13 poisontheused User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 2 h 52 m 56 sec
Reputation Power: 0
Thank You very much

Thanks a lot.. much appreciated, that should help me plenty.

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > How to process this XML file in HTML


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway
Stay green...Green IT