XML Formatting

Questions & Answers about Helium Scraper 3
Post Reply
pearljam
Posts: 2
Joined: Thu Feb 07, 2019 4:00 am

XML Formatting

Post by pearljam » Thu Feb 07, 2019 11:44 pm

Thanks for your help. This is no big deal but I was wondering if this was possible. I have two extract commands, one inside another, and the nested one has a single column called tag. This is a one-to-many table so there may be many tags for each row on the parent table. The problem I'm having is that the tag section of my XML look like this:

Code: Select all

<tags>
  <tag>value 1</tag>
</tags>
<tags>
  <tag>value 2</tag>
</tags>
But I want it to look like this:

Code: Select all

<tag>value 1</tag>
<tag>value 2</tag>

webmaster
Site Admin
Posts: 521
Joined: Mon Dec 06, 2010 8:39 am
Contact:

Re: XML Formatting

Post by webmaster » Fri Feb 08, 2019 3:26 pm

You can do this by renaming your tags column on the top extract to tag, and renaming your tag column on the nested extract to value, so that instead of this:

Code: Select all

extract
   tags
      extract
         tag
            [value]
You use this:

Code: Select all

extract
   tag
      extract
         value
            [value]
Whenever an extract has a single column called value, Helium will ignore this column when exporting to XML. It uses the same logic as when manually exporting from a table set.
Juan Soldi
The Helium Scraper Team

Post Reply