in reply to Re^2: XML::Twig Stream root children
in thread XML::Twig Stream root children

xml_split does not create valid xml documents.

Sure it does. Observe

$$ echo THIS IS THE SAME AS xml_split -v Herkum.xml $$ xml_split -v -c "level(1)" Herkum.xml generating main file Herkum-00.xml generating Herkum-01.xml generating Herkum-02.xml $$ cat Herkum-00.xml && echo <root> <?merge subdocs = 0 :Herkum-01.xml?> <?merge subdocs = 0 :Herkum-02.xml?> </root> $$ cat Herkum-01.xml && echo <a> <b>Test</b> </a> $$ cat Herkum-02.xml && echo <aa> <b>Test</b> </aa>
You can use "level(1)" with twig_handlers

Replies are listed 'Best First'.
Re^4: XML::Twig Stream root children
by mirod (Canon) on Oct 03, 2009 at 16:08 UTC
    You can even do xml_split -l 1

      using the 'level(1)' as the Anonymous Monk suggested does the trick. The question I have now, is where is this documented? I only saw one it mentioned once in the XML::Twig POD and I found an example in the unit tests.

      Update: I take this back, I did find in the documentation. Though I had never noticed it before. This project has been a good learning experience.