in reply to XML Parsing in a "mixed content" file
Is that a static html file or dynamically with a script (like cgi) ?
Update - Are you looking for something as simple as this ?
poj#!perl use strict; use HTML::Entities; open OUT,'>', 'template.html' or die "$!"; print OUT '<html><body><pre>'; while (<DATA>){ print OUT encode_entities($_); } print OUT '</pre></html>'; __DATA__ <?xml version="1.0" encoding="ISO-8859-1"?> <workbook> <worksheet name="[% config.template %]"><format color="black"> [% FOREACH host IN hosts %] <row><bold><format color="white" size="14" bg_color="blue"><cell w +idth="60" text="Configuring de : [% host.name %]" /></format></bold>< +/row> <row /> [% FOREACH int IN host.interfaces %] <row><cell text="interface ip-bundle [% int.bundle %].[% int.subBu +ndle %]" /></row> [% FOREACH ip IN int.secondaries %] <row><cell text=" ip address [% ip.ipAddress %] [% ip.subnetMask % +] [% bits(ip.ipAddress,ip.subnetMask) %] secondary" /></row> [% END %] <row><cell text="!"/></row> [% END %] <row /> <row><bold><format color="white" size="14" bg_color="blue"><cell t +ext="END OF : [% host.name %]" /></format></bold></row> <row /><row /><row /> [% END %] </format> </worksheet> </workbook>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: XML Parsing in a "mixed content" file
by llarochelle (Beadle) on Jan 11, 2019 at 18:51 UTC |