I have a problem with writing a CSV file to XML.
CSV File
[Folder];;;;;
[Folder\Subfolder1];;;;;
[Folder\Subfolder1\Subfolder2];;;;;
"Descriptive stuff";"its a password";"user or something";"a URL";"if anyone has a comment"
[Folder\Subfolder1\Subfolder3];;;;;
"Descriptive stuff";"its a password";"user or something";"a URL";"if anyone has a comment"
XML Output
<?xml version="1.0" encoding="utf-8"?>
<PASSWORDFILE xmlns="http://www.password-depot.de/schemas/passwordfile/6.0/passwordfile.xsd">
<PASSWORDS>
<GROUP NAME="Folder">
<GROUP NAME="Subfolder1">
<GROUP NAME="Subfolder2">
<ITEM>
<DESCRIPTION>Descriptive stuff</DESCRIPTION>
<PASSWORD>its a password</PASSWORD>
<USERNAME>user or something</USERNAME>
<URL>a URL</URL>
<COMMENT>if anyone has a comment</COMMENT>
</ITEM>
</GROUP>
<GROUP NAME="Subfolder3">
<ITEM>
<DESCRIPTION>Descriptive stuff</DESCRIPTION>
<PASSWORD>its a password</PASSWORD>
<USERNAME>user or something</USERNAME>
<URL>a URL</URL>
<COMMENT>if anyone has a comment</COMMENT>
</ITEM>
</GROUP>
</GROUP>
</GROUP>
</PASSWORDS>
</PASSWORDFILE>
My problem is solely, that I don't know how to close the GROUP Tag after I have used it. At the moment I just close the GROUP Tag at the very end of the XML making a huge massive tree.
GROUPelements as you pop from the stack. It's definitely not a one-liner, though.