Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^3: XML::Twig Stream root children

by Anonymous Monk
on Oct 03, 2009 at 01:47 UTC ( [id://798966]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://798966]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (3)
As of 2024-04-24 17:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found