in reply to Re: Edit XML through XML Compile
in thread Edit XML through XML Compile
Up to now i got my code writing the properties.-data -properties (List of properties in here) -suites -tests
So the first part of my XML File is generated. Later on, in a completely different part of the program, tests have to be written into the second section. Those tests have to comply the Schema in the xsd file. So i have to reopen the saved XML file from the code above and insert some new tags in it, at specific Points (every test has to go into a specific Suite, so there is more than one Suite) Writing a new hash and doing$schema->template('PERL', $type); #warn $schema->template('PERL', $type); my $doc = XML::LibXML::Document->new('1.0', 'UTF-8'); my $write = $schema->compile(WRITER => $type, use_default_namespace +=> 1); my %hash; #some filling of the hash with values my $xml = $write->($doc, $hash); $doc->setDocumentElement($xml);
again, does not work out. I need to reopen, search a node and insert children. This was easy possible with XML Twig, but as said i can only use above mentioned packages. Was this enough code or do you Need more explaning?my $xml = $write->($doc, $hash); $doc->setDocumentElement($xml);
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Edit XML through XML Compile
by Anonymous Monk on Dec 21, 2014 at 15:53 UTC | |
by chenino (Acolyte) on Dec 22, 2014 at 15:10 UTC | |
by Anonymous Monk on Dec 22, 2014 at 20:03 UTC |