I am trying to work out how to obtain the ID from the param at the top of the context of an XML feed.
The XML looks like this:
<vacancies>
<vacancy id="111747">
<uri>https://data.ox.ac.uk/id/vacancy/111747</uri>
<url>https://data.ox.ac.uk/doc/vacancy/111747</url>
<webpage>https://www.recruit.ox.ac.uk/pls/hrisliverecruit...</webpage>
<label>Research Assistant - Genome Integrity</label>
<opens>2014-01-31T11:28:56+00:00</opens>
<closes>2014-02-21T12:00:00+00:00</closes>
</vacancy>
<vacancy id="111923">
<uri>https://data.ox.ac.uk/id/vacancy/111923</uri>
<url>https://data.ox.ac.uk/doc/vacancy/111923</url>
....
I need to work out the correct syntax to use to map the id of the vacancy to the guid.
What is the correct context that will give me the ability to pull out this ID? I have tried
- a context of /vacancies/vacancy (and //vacancy) and mapping @id
- a context of /vacancies and mapping vacancy@id (and also vacancy[@id])
- and a few other combinations that produced "invalid syntax" warnings.
All of these suggestions just inform me that there are no new nodes and nothing is imported, with no errors.
The feed I am using is at https://data.ox.ac.uk/feeds/vacancies/23232705.xml
I have had feed imports work from this feed before but they were using the title as the unique field which is no longer feasible.
Any help welcome.
Cheers
Paul
Comments
Comment #1
twistor commentedThe problem is that you have xhtml embedded in your xml that isn't escaped. That's not technically wrong, but it screws with xpath. The xhtml declares a default namespace, which runs you into this bug #1220834: Default namespace declared outside of top level element breaks parsing..
Currently, the only thing you can do is escape the xhtml.
There is another way around this, but I haven't implemented it yet, since this is not a common bug, and I don't really have the time. :/