Categories > TinyButStrong general >

XML and TinyButStrong !!!

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Rromulo
Date: 2008-01-14
Time: 11:39

XML and TinyButStrong !!!

My XML is

<?xml version="1.0" encoding="ISO-8859-1" ?>
<CABECALHO>
<Criacao>03/12/2007</Criacao>
<Ano>2007</Ano>
<Mes>11</Mes>
<Unidade>011</Unidade>
<SERVIDOR>
  <Matricula>123</Matricula>
  <Nome>Alef</Nome>
  <Situacao>Ativo</Situacao>
  <Bruto>1.00</Bruto>
  <Desconto>0.50</Desconto>
  <Liquido>0.50</Liquido>
</SERVIDOR>
<SERVIDOR>
  <Matricula>321</Matricula>
  <Nome>Guimet</Nome>
  <Situacao>Ativo</Situacao>
  <Bruto>2.50</Bruto>
  <Desconto>1.00</Desconto>
  <Liquido>1.50</Liquido>
</SERVIDOR>
</CABECALHO>


Necessary to show xml above in the following way:

criacao | ano | mes | unidade | servidor | matricula | nome | situacao | bruto | desconto | liquido |
03/12/2007 | 2007 | 11 | 011 | 123 | Alef | Ativo | 1.00 | 0.50 | 0.50 |

03/12/2007 | 2007 | 11 | 011 | 321 | Guimet | Ativo | 2.50 | 1.00 | 1.50

as to make using tinybutstrong ?

By: Skrol29
Date: 2008-01-14
Time: 11:51

Re: XML and TinyButStrong !!!

Hi Rromulo,

TBS can make an XML content, but it cannot read an XML content.
If you want to read you XML, you have to use an XML parser (I think one is provided with PHP 5), or to code your own XML parser for this structure.

Since you have you XML data translated into an array, then TBS can merge it.
By: TomH
Date: 2008-01-14
Time: 13:35

Re: XML and TinyButStrong !!!

I did find a very simple to use XML parser by Keith Devans at the site http://keithdevens.com/software/phpxml

It easily creates an object from your XML

Then you can use that object directly in TBS->MergeBlock

Very simple that way, really.

There is an example of how I used it, with the source code, at http://tomhenry.us/tbs3/  look at the last application on that page.

Hope that helps,
TomH
By: Rromulo
Date: 2008-01-14
Time: 14:49

Re: XML and TinyButStrong !!!

IS PERFECT !!!!!!

Very Grateful