Jump to content

How to dump my element tree?


mrvicio

Recommended Posts

You can view a live (serverside) element tree with the elementbrowser resource. Just start 'elementbrowser', go to the server's webpage and click on "Element browser".

If you really want Lua code, something like this (untested):

RootNode = xmlCreateFile("dump.xml"," root") 
RootElement = getRootElement() 
  
function dumpNode ( element, node ) 
    for name, value in pairs( getAllElementData(element) ) do 
        xmlNodeSetAttribute(node, name, tostring(value)) 
    end 
    for _,child in ipairs(getElementChildren(element)) do 
        dumpNode ( child, xmlCreateChild(node, getElementType(element)) ) 
    end 
end 
  
dumpNode ( RootElement, RootNode ) 

Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...