I've read the Twig documentation and Jenda's article but as a newbie I'm still lost. Can any one suggest the code for splitting one xml file into multiple xml files based on a particular element with the name of each new file being the datetime the file was created. I do know how to generate the datetime stamp
One new file needs be created for each <Message> element from the original xml file. Each message section can have different child elements so I need to grab everything between <Message> ... </Message> and write it to a new file. The original xml file has the format :
<?xml version="1.0" encoding="utf-8"?>
<TheRoot>
 <Message>
  <MyNumber>001</MyNumber>
  <Registration>222</Registration>
  <GPS>
   <Year>2009</Year>
  </GPS>
  <LbtSession>
   <Year>2009</Year>
  </LbtSession>
 </Message>
 <Message>
  <MyNumber>887</MyNumber>
  <Registration>333</Registration>
  <Client>None</Client>
  <Type>Position</Type>
 </Message>
 <Message>
 etc...
 </Message>
 <Message>
 etc ...
 </Message>
</TheRoot>
Thank you in advance.
In reply to Splitting xml file into multiple files by xmlsql
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |