Hello,

I have a xml file that I need to parse. At the moment, I have some problems with it. Perhaps someone can help me out...

The XML file looks like this:

<?xml version="1.0" encoding="UTF-8"?>
<Tours>
  <Tour ID="111">
    <Title>...</Title>
    <Description>...</Description>
    <Events>
      <Event ID="1111">
        <Date>2012-08-12</Date>
        <Location>Miami</Location>
      </Event>
      <Event ID="1112">
        <Date>2012-08-14</Date>
        <Location>New York</Location>
      </Event>
      <Event ID="1113">
        <Date>2012-08-15</Date>
        <Location>Chicago</Location>
      </Event>
    </Events>
  </Tour>
  <Tour ID="112">
    <Title>...</Title>
    <Description>...</Description>
    <Events>
      <Event ID="1121">
        <Date>2012-07-12</Date>
        <Location>Denver</Location>
      </Event>
      <Event ID="1122">
        <Date>2012-07-14</Date>
        <Location>San Diego</Location>
      </Event>
    </Events>
  </Tour>
</Tours>
</xml>

Every single Event should become one node (with Date, Location and the tour-shared title and description).
At the moment I can only import one Event (Date/Location) per Tour, but not all of them.

I use the following settings for the xpath parser:
Context: /Tours/Tour
title: Title
body: Description
guid: Events/Event/@id
date: Events/Event/Date
location: Events/Event/Location

Has someone an idea how I can export all events (all events for every tour)?

Comments

d.holmen@gmail.com’s picture

Same thing here.

MJH’s picture

Try the following:
Context: /Tours/Tour/Events/Event
title: ../../Title
body: ../../Description
guid: @ID
date: Date
location: Location

twistor’s picture

Status: Active » Fixed

@MJH has it.

Consider adding this to the docs.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.