Categories > TinyButStrong general >

Seem to be a bug with TBS 3.20, block and short XML closing tag

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Olivier
Date: 2007-06-12
Time: 15:47

Seem to be a bug with TBS 3.20, block and short XML closing tag

Hi,

I've the following content generated with TBS and a XML template works well.
It produces this following XML content :
<photos nombre="5">
  <photo item="1">
    <src>
      ./Images/07-5-12_11-26_1-329.JPG
    </src>
  </photo>
  <photo item="2">
    <src>
      ./Images/07-5-12_11-26_2-329.JPG
    </src>
  </photo>
  <photo item="3">
    <src>
      ./Images/07-5-12_11-27_1-329.JPG
    </src>
  </photo>
  <photo item="4">
    <src>
      ./Images/07-5-12_11-27_2-329.JPG
    </src>
  </photo>
  <photo item="5">
    <src>
      ./Images/07-5-12_11-27_3-329.JPG
    </src>
  </photo>
</photos>


with the PHP code
  include_once('tbs_class_php4.php');
  $TBS = new clsTinyButStrong ;
  $TBS->LoadTemplate('carview.xml', 'ISO8859-15');
  $TBS->MergeBlock('blk',  'array', 'a_carview');
  $TBS->MergeBlock('blk2', 'array', 'a_carview[%p1%][photo]');
  header("Content-Type:text/xml; charset=ISO-8859-1");
  $TBS->Show() ;

and the XML template :
  <photos nombre="[blk.nb_photo]">
    <photo item="[blk2.#]">
      <src>[blk2.src;block=photo;p1=[blk.$]]</src>
    </photo>
  </photos>

Now I want to optimize the XML code by this way to include src as an attribute into the 'photo' tag, and TBS said

The template simplified:
  <photos nombre="[blk.nb_photo]">
    <photo item="[blk2.#]" src="[blk2.src;block=photo;p1=[blk.$]]"></photo>
  </photos>

The result is OK :
  <photos nombre="4">
    <photo item="1" src="./Images/07-5-5_10-4_1-329.JPG"/>
    <photo item="2" src="./Images/07-5-5_10-4_2-329.JPG"/>
    <photo item="3" src="./Images/07-5-5_10-4_3-329.JPG"/>
    <photo item="4" src="./Images/07-5-5_10-5_1-329.JPG"/>
  </photos>

But I want to use the simplified syntax of XML closing tag in the template like :
  <photos nombre="[blk.nb_photo]">
    <photo item="[blk2.#]" src="[blk2.src;block=photo;p1=[blk.$]]" />
  </photos>

The result is NOT OK, here the message from TBS :
TinyButStrong Error in block's definition [blk2.src...] : at least one tag corresponding to photo is not found. Check opengin tags, closing tags and levels.
TBS don't detect the closing tag like />

Olivier

By: Olivier
Date: 2007-06-12
Time: 15:49

Re: Seem to be a bug with TBS 3.20, block and short XML closing tag

Hi again,

for older TBS version is the same problem.
I think it's important that TBS support this short closing tag, because XHTML need this to.

Regards,
Olivier
By: Skrol29
Date: 2007-06-16
Time: 00:07

Re: Seem to be a bug with TBS 3.20, block and short XML closing tag

Hi,

It works but you have to code "block=photo/" instead of "block=photo".
By: Olivier
Date: 2007-06-16
Time: 08:15

Re: Seem to be a bug with TBS 3.20, block and short XML closing tag

Thanks Skrol :))
When I say bug, I want to say unsupported feature.

Olivier