Hi,
Following is the xml file which I have. Now in this file, I need all the values between fields <FormattedReportObjects>xyz</FormattedReportObjects>, thus I need all such "xyz" values and want to store in an array.
Can anyone help me to do that ?
Thanks.
<?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> - <FormattedReportObject xsi:type="CTFormattedSubreport"> <ObjectName>Subreport1</ObjectName> - <FormattedAreaPair Level="0" Type="Report"> - <FormattedArea Type="Header"> - <FormattedSections> - <FormattedSection SectionNumber="0"> <FormattedReportObjects /> </FormattedSection> - <FormattedSection SectionNumber="1"> <FormattedReportObjects /> </FormattedSection> </FormattedSections> </FormattedArea> - <FormattedAreaPair Level="1" Type="Details"> - <FormattedArea Type="Details"> - <FormattedSections> - <FormattedSection SectionNumber="0"> <FormattedReportObjects /> </FormattedSection> </FormattedSections> </FormattedArea> </FormattedAreaPair> - <FormattedArea Type="Footer"> - <FormattedSections> - <FormattedSection SectionNumber="0"> <FormattedReportObjects /> </FormattedSection> - <FormattedSection SectionNumber="1"> <FormattedReportObjects /> </FormattedSection> </FormattedSections> </FormattedArea> </FormattedAreaPair> </FormattedReportObject> </FormattedReportObjects> </FormattedSection> - <FormattedSection SectionNumber="1"> - <FormattedReportObjects> - <FormattedReportObject xsi:type="CTFormattedSubreport"> <ObjectName>Subreport2</ObjectName> - <FormattedAreaPair Level="0" Type="Report"> - <FormattedArea Type="Header"> <FormattedSections /> </FormattedArea> - <FormattedArea Type="Footer"> <FormattedSections /> </FormattedArea> </FormattedAreaPair> </FormattedReportObject> </FormattedReportObjects> </FormattedSection> </FormattedSections> </FormattedArea> - <FormattedAreaPair Level="1" Type="Group"> - <FormattedArea Type="Header"> - <FormattedSections> - <FormattedSection SectionNumber="0"> - <FormattedReportObjects> - <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" + FieldName="GroupName ({Data.SYSTEM})"> <ObjectName>Field4</ObjectName> <FormattedValue>System lgloe040</FormattedValue> <Value>System lgloe040</Value> </FormattedReportObject> </FormattedReportObjects> </FormattedSection> </FormattedSections> </FormattedArea> - <FormattedAreaPair Level="2" Type="Group"> - <FormattedArea Type="Header"> - <FormattedSections> - <FormattedSection SectionNumber="0"> - <FormattedReportObjects> - <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" + FieldName="GroupName ({Data.TYPE})"> <ObjectName>Field5</ObjectName> <FormattedValue>Type LOG</FormattedValue> <Value>Type LOG</Value> </FormattedReportObject> </FormattedReportObjects> </FormattedSection> </FormattedSections> </FormattedArea> - <FormattedAreaPair Level="3" Type="Details"> - <FormattedArea Type="Details"> - <FormattedSections> - <FormattedSection SectionNumber="0"> - <FormattedReportObjects> - <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" + FieldName="{Data.OWNER}"> <ObjectName>Field6</ObjectName> <FormattedValue>\</FormattedValue> <Value>\</Value> </FormattedReportObject> - <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" + FieldName="{Data.PATH}"> <ObjectName>Field10</ObjectName> <FormattedValue>C:\abc\</FormattedValue> <Value>C:\abc\</Value> </FormattedReportObject> - <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" + FieldName="{Data.NAMETYPE}"> <ObjectName>Field16</ObjectName> <FormattedValue>weru3453.log</FormattedValue> <Value>weru3453.log</Value> </FormattedReportObject> - <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" + FieldName="{@DBS_FileSize}"> <ObjectName>Field15</ObjectName> <FormattedValue>4</FormattedValue> <Value>4</Value> </FormattedReportObject> - <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" + FieldName="{@DBS_DateAcc}"> <ObjectName>Field8</ObjectName> <FormattedValue>12/12/2005</FormattedValue> <Value>12/12/2005</Value> </FormattedReportObject> - <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" + FieldName="{@DBS_DateMod}"> <ObjectName>Field9</ObjectName> <FormattedValue>12/12/2005</FormattedValue> <Value>12/12/2005</Value> </FormattedReportObject> - <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" + FieldName="{@DBS_DateCre}"> <ObjectName>Field11</ObjectName> <FormattedValue>12/12/2005</FormattedValue> <Value>12/12/2005</Value> </FormattedReportObject> </FormattedReportObjects> </FormattedSection> </FormattedSections> </FormattedArea> </FormattedAreaPair> - <FormattedAreaPair Level="3" Type="Details"> - <FormattedArea Type="Details"> - <FormattedSections> - <FormattedSection SectionNumber="0"> - <FormattedReportObjects> - <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" + FieldName="{Data.OWNER}"> <ObjectName>Field6</ObjectName> <FormattedValue>\</FormattedValue> <Value>\</Value> </FormattedReportObject> - <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" + FieldName="{Data.PATH}"> <ObjectName>Field10</ObjectName> <FormattedValue>C:\abc\</FormattedValue> <Value>C:\abc\</Value> </FormattedReportObject> - <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" + FieldName="{Data.NAMETYPE}"> <ObjectName>Field16</ObjectName> <FormattedValue>sdfsdfs.log</FormattedValue> <Value>sdfsdfs.log</Value> </FormattedReportObject> - <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" + FieldName="{@DBS_FileSize}"> <ObjectName>Field15</ObjectName> <FormattedValue>4</FormattedValue> <Value>4</Value> </FormattedReportObject> - <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" + FieldName="{@DBS_DateAcc}"> <ObjectName>Field8</ObjectName> <FormattedValue>12/12/2005</FormattedValue> <Value>12/12/2005</Value> </FormattedReportObject> - <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" + FieldName="{@DBS_DateMod}"> <ObjectName>Field9</ObjectName> <FormattedValue>12/12/2005</FormattedValue> <Value>12/12/2005</Value> </FormattedReportObject> - <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" + FieldName="{@DBS_DateCre}"> <ObjectName>Field11</ObjectName> <FormattedValue>12/12/2005</FormattedValue> <Value>12/12/2005</Value> </FormattedReportObject> </FormattedReportObjects> </FormattedSection> </FormattedSections> </FormattedArea> </FormattedAreaPair> - <FormattedArea Type="Footer"> - <FormattedSections> - <FormattedSection SectionNumber="0"> - <FormattedReportObjects> - <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" + FieldName="{@DBS_FileSizeSum_Typ}"> <ObjectName>Field24</ObjectName> <FormattedValue>8</FormattedValue> <Value>8</Value> </FormattedReportObject> </FormattedReportObjects> </FormattedSection> </FormattedSections> </FormattedArea> </FormattedAreaPair> - <FormattedArea Type="Footer"> - <FormattedSections> - <FormattedSection SectionNumber="0"> - <FormattedReportObjects> - <FormattedReportObject xsi:type="CTFormattedText"> <ObjectName>Text10</ObjectName> <TextValue>System Total</TextValue> </FormattedReportObject> - <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" + FieldName="{@DBS_FileSizeSum_Sys}"> <ObjectName>Field17</ObjectName> <FormattedValue>8</FormattedValue> <Value>8</Value> </FormattedReportObject> </FormattedReportObjects> </FormattedSection> </FormattedSections> </FormattedArea> </FormattedAreaPair> - <FormattedArea Type="Footer"> - <FormattedSections> - <FormattedSection SectionNumber="0"> - <FormattedReportObjects> - <FormattedReportObject xsi:type="CTFormattedText"> <ObjectName>Text11</ObjectName> <TextValue>Report Total</TextValue> </FormattedReportObject> - <FormattedReportObject xsi:type="CTFormattedField" Type="xsd:string" + FieldName="{@DBS_FileSizeSum_Rpt}"> <ObjectName>Field25</ObjectName> <FormattedValue>8</FormattedValue> <Value>8</Value> </FormattedReportObject> </FormattedReportObjects> </FormattedSection> </FormattedSections> </FormattedArea> </FormattedAreaPair> </FormattedReport>
Formatting fixed by GrandFather
In reply to parsing xml file and get the values by devlele
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |