Re: Structured HTML to XML
Greg Robinson <[email protected]>
| Newsgroups | gmane.comp.windows.devel.dotnet.winforms |
|---|---|
| Message-ID | <[email protected]> |
My mistake, it's been a few years since I worked with XSLT, yes you need xml input but can transfer it to xml, html and other formats. Greg Robinson Custom Data Systems, Inc. www.cds-am.net -----Original Message----- From: Discussion forum for developers using Windows Forms to build apps and controls [mailto:[email protected]]On Behalf Of R. Rogers Sent: Friday, March 30, 2007 1:24 PM To: [email protected] Subject: Re: [DOTNET-WINFORMS] Structured HTML to XML I'm new to this; I was under the impression that XSLT input and output XML. Was that not quite correct? -----Original Message----- From: Discussion forum for developers using Windows Forms to build apps and controls [mailto:[email protected]] On Behalf Of Greg Robinson Sent: March 30, 2007 12:47 PM To: [email protected] Subject: Re: [DOTNET-WINFORMS] Structured HTML to XML XSLT maybe? Greg Robinson Custom Data Systems, Inc. www.cds-am.net -----Original Message----- From: Discussion forum for developers using Windows Forms to build apps and controls [mailto:[email protected]]On Behalf Of R. Rogers Sent: Friday, March 30, 2007 11:59 AM To: [email protected] Subject: [DOTNET-WINFORMS] Structured HTML to XML Hello, My task is to convert race results like this to XML: http://www.sportstats.ca\res1997\nord10k.htm You can see that there are 1,948 race results. I need to create 1,948 xml elements. I would like to see XML data like this: <Racer> <Place>1</Place> <ClockTime>29:41</ClockTime> <PacePerK>2:59</PacePerK> <BibNumber>1868</BibNumber> <Name>Rachid TBAHI</Name> <City>Sleepy Hollow</City> <Prov>NY</Prov> <CategoryPlace>1/213</CategoryPlace> <GenderPlace>1/1216</GenderPlace> <Category>Men 30-34</Category> </Racer> I've shown just the first entry, and would expect to see 1,947 more. A few months ago, I wrote some C# code that would convert the URL above to the kind of XML I wanted. I noticed that the race results were all after a <pre> tag. I found that I had to use a C# regular expression to parse the race results. Creating one regular expression isn't so bad, but there is so much race results data, conforming to many different regular expressions, that this becomes a large project for me. Recently, I found out about Dapper and thought it would be able to make this a manageable project. Their website is here: http://www.dapper.net/ I have tried unsuccessfully to create a Dapp that will do this. If you look at the source html for the sportstats URL, you will see that there isn't anything delineating the attributes I need to capture. It's not like a CSV file - it's more like an old fashioned mainframe fixed width file. I can't seem to define fields for the Dapp, as a result. Any suggestions are most welcome! Richard Rogers