Search This Site
May 16 2008 10:10 UTC | ||||||||||||||||||||||||||||||||
Tutorials
Quick LinksQuestions
Got a question for us? Quality
Payment MethodsBookmarks |
Previous Competition Winners
Back to the main competition page. Competition #3, June 26th, 2006XML Manager Winner: The data to extract:
...from this XML: <html> <body> <div> <h1>First Paragraph</h1> <a href="http://www.example.com/first">First</a> <p>Lorem <a href="http://www.example.com/ipsum">ipsum</a> dolor sit amet, consectetuer adipiscing elit. Etiam sit <a href="http://www.example.com/amet">amet</a> diam vestibulum diam posuere suscipit. Nam convallis.</p> <p>Phasellus <a href="http://www.example.com/semper">semper</a>, nisl ac malesuada sodales, libero sapien vestibulum libero, quis cursus enim ligula sit amet justo.</p> </div> <div> <h1>Second Paragraph</h1> <a href="http://www.example.com/second">Second</a> <p>Donec iaculis, enim sit amet lobortis dapibus, felis <a href="http://www.example.com/nunc">nunc</a> pulvinar nibh, id varius eros ante et nunc.</p> </div> </body> </html>And the winning solutions were: RECORD: //a FIELD 1: @href FIELD 2: . Comments RECORD: /html/body/div[*]//a FIELD 1: @href FIELD 2: .
This one was from Gustavo Valdés Aracena. In this solution, the record XPath is used to specify the exact subset of
One other minor point: the predicate on the Competition #2, March 20th, 2006XML Manager Winner: The challenge was to extract this data...
...from this XML:
<addressbook>
<person firstname="Isaac" lastname="Newton">
<phone>051 8706351</phone>
<address>
1 Apple Avenue.
Lincolnshire.
</address>
</person>
<person firstname="Micheal" lastname="Faraday">
<phone>051 8706352</phone>
<address>
2 Spark Street.
Surrey.
</address>
</person>
<person firstname="Albert" lastname="Einstein">
<phone>051 8706353</phone>
<address>
3 Relative Road.
Princeton.
</address>
</person>
</addressbook>
And the winning solution was:
RECORD: /addressbook/person FIELD 1: @firstname FIELD 2: @lastname FIELD 3: phone FIELD 4: address Comments
There is one additional refinement to this solution. In a field path, the name of an element returns all the text inside that element. In this case,
Competition #1, March 6th, 2006XML Manager Winner: The challenge was to extract this data...
...from this XML:
<table>
<tr>
<td>Bugs</td><td>Bunny</td>
</tr>
<tr>
<td>Homer</td><td>Simpson</td>
</tr>
<tr>
<td>Fred</td><td>Flintstone</td>
</tr>
</table>
And the winning solution was:
RECORD: /table/tr FIELD 1: td[1]/text() FIELD 2: td[2]/text() Comments
The winning entry uses the | |||||||||||||||||||||||||||||||
|
comment on this page
Home |
Search |
About Us |
Contact Us |
Our Products |
Documentation |
Resources |
Login
Copyright © 2004-2008 Ricebridge. All Rights Reserved. | ||||||||||||||||||||||||||||||||