Guest Walt Posted October 7, 2005 Share Posted October 7, 2005 I have an XML file that is an export from a crystal report. I would like to transfor or parse the data into a table format that will be used as an include in an asp page. The format of the xml file is new to me. I can work with XML files that have different element names of the same node but the crystal reports schema uses the same element name throughout the XML file. Below is the beginning of the XML file. I also need to rearrange the order of the data. In this case the desciption of the item is after the three cost levels. I am totally lost with this type of XML file.Sorry for the jumbled mess below. Any help would be greatly appreciated. I have highlited the data I need to parse for each node. The preceding FieldName="{inprd.common}" for each element is what describes the data.<?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"><FormattedArea Type="Header"><FormattedSections><FormattedSection SectionNumber="0"><FormattedReportObjects></FormattedReportObjects></FormattedSection></FormattedSections></FormattedArea><FormattedAreaPair Level="1" Type="Group"><FormattedArea Type="Footer"><FormattedSections><FormattedSection SectionNumber="0"><FormattedReportObjects><FormattedReportObject xsi:type="CTFormattedField" Type="xsd:decimal" FieldName="Sum ({@Price_1}, {initm.description})"><ObjectName>Field9</ObjectName><FormattedValue>$11.25</FormattedValue><Value>11.25</Value></FormattedReportObject><FormattedReportObject xsi:type="CTFormattedField" Type="xsd:decimal" FieldName="Sum ({@Price_10}, {initm.description})"><ObjectName>Field10</ObjectName><FormattedValue>$10.50</FormattedValue><Value>10.50</Value></FormattedReportObject><FormattedReportObject xsi:type="CTFormattedField" Type="xsd:decimal" FieldName="Sum ({@Price_50}, {initm.description})"><ObjectName>Field11</ObjectName><FormattedValue>$10.00</FormattedValue><Value>10.00</Value></FormattedReportObject><FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{initm.description}"><ObjectName>Field12</ObjectName><FormattedValue>ABELIA EDWARD GOUCHER #3</FormattedValue><Value>ABELIA EDWARD GOUCHER #3</Value></FormattedReportObject><FormattedReportObject xsi:type="CTFormattedField" Type="xsd:decimal" FieldName="{@Available}"><ObjectName>Field13</ObjectName><FormattedValue>51</FormattedValue><Value>51.00</Value></FormattedReportObject><FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" FieldName="{inprd.common}"><ObjectName>Field14</ObjectName><FormattedValue>PURPLE-PINK ABELIA</FormattedValue><Value>PURPLE-PINK ABELIA</Value></FormattedReportObject></FormattedReportObjects></FormattedSection></FormattedSections></FormattedArea></FormattedAreaPair> Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now