in reply to Re: XML Parsing in a "mixed content" file
in thread XML Parsing in a "mixed content" file
Hi Marto, the source data is XML with TT instructions in the file.
The XML is intended to create and XLS file.Below is an extract
So what I want to do, is extract both "cell text" and TT instructions to recreate the content in HTML format. Problem is, how should I parse the file so that I can retrieve XML with XML::LibXML & TT instruction lines at the same time ? Like I said, my objective is to display the template to the users. Creating the XLS file is not a problem. I want to show network engineers how the template is built without giving access to the .tt file.<?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^3: XML Parsing in a "mixed content" file
by marto (Cardinal) on Jan 11, 2019 at 16:53 UTC | |
by llarochelle (Beadle) on Jan 11, 2019 at 17:48 UTC |