Syntactic Confectionery Delight | |
PerlMonks |
Re^2: Creating Nodes in namespace with XML::LibXMLby worik (Sexton) |
on Jun 05, 2015 at 01:42 UTC ( [id://1129147]=note: print w/replies, xml ) | Need Help?? |
you haven't given a runnable piece of codeTrue. My bad. Sorry That said I have worked out the XML::LibXML approach. For example I want to build:
The following code does it....
Where a sub tree is a leaf it says:
Where the sub-tree is the root of another sub-tree itself it says:
This works out nicely and does what I want. If I want a different tree:
I change the core of the programme to:
What I expected to be writing, when adding a sub-tree, was some thing like:
The only reason (I can see, with my inexperience) to pass the root is for the namespace prefix information. It is nice to use prefixes, and I can see with hindsight that it would require some post processing of the tree to achieve that. So what I was expecting is not the "XML::LibXML" way. Fair enough So the answer to my question was "No, yes". Simple really Another thing. Some one said: I strongly suggest you take the time to read all of its documentation. Sensible advice. I have been doing exactly that. There are thousands and thousands of lines there, and they are organised as a reference not an introduction. It is hard to start the learning curve with XML::LibXML. In the absence of an introductory document there will be stupid sounding questions from beginners.
In Section
Seekers of Perl Wisdom
|
|