I'm not sure if this would really fit into the module, but I thought it may be worth it to start a discussion.

Consider an xml file that contains with a structure like this

<dealership>
  <name>Bob's Car Lot</name>
  <description> We sell cool cars</description>
  <car>
    <make>Toyota</make>
    <model>Camry</make>
  </car>
  <car>
     <make>Infiniti</make>
     <model>G20</make>
  </car>
</dealership>
<dealership>
  <name>John's Car Lot</name>
  <description> We sell cooler cars</description>
  <car>
    <make>Dodge</make>
    <model>Durango</make>
  </car>
  <car>
     <make>Toyota</make>
     <model>Corolla</make>
  </car>
</dealership>

Suppose you wanted to parse that file and in one feeds run create a set of 'dealership' nodes referenced to 'car' nodes. Currently the best way to do that is by saying context = dealership and then something like dealership>car and restructuring the arrays to give to your processor on hook_after_parse. You can't go the other way (ie context = car) because CSS has no parent operators you can use.

I'm proposing a way to set several levels of sub-contexts....

What do you guys think?

Comments

emptyvoid’s picture

Wait, are you saying that I can't select nodes at multiple levels of target fragment?
So the way the GUI was programmed it doesn't traverse multiple levels of nodes in the XML structure?

Then this is totally useless, most XML files have multiple levels rarely have I had XML content that was "flat" and only one level. Furthermore, many XML files I have used in the past also use the notion of:

<container>
   <item>text content</item>
   <item>text content</item>
   <item>text content</item>
</container>

or

<container>
   <item attribute1="property" attribute2="property" />
   <item attribute1="property" attribute2="property" />
   <item attribute1="property" attribute2="property" />
</container>

If this isn't supported by the GUI (but I know it is supported leveraging the querypath library) then I'll just write a custom module that truly leverages the querypath library instead of contorting my brain trying to get the lame GUI to somehow actually meet the needs of what I'm trying to accomplish (holy run on sentence batman).