Invenzzia »

IMPORTANT ANNOUNCEMENT

Due to the uncertain status of the Flyspray project, lack of new releases and moving the code repository to Github, we decided to shutdown this issue tracker by the end of January 2011. From that date, the bugs should be reported directly in Github project repositories.

List of repositories:

Open Power Template 2.x family

PLEASE PROVIDE THE TEMPLATES AND/OR PHP CODE IN THE TASK DESCRIPTION (Not URL-s to them). THAT ALLOWS US TO REPRODUCE THE PROBLEM! OTHERWISE WE ARE NOT ABLE TO HELP YOU!

Remember to hide all the security-related pieces of code from the task description, like passwords, server paths etc. for your own safety. Once we close the task, we cannot edit it anymore!
Tasklist

FS#97 - parse: and XML-Namespaces

Attached to Project: Open Power Template
Opened by Skruppy (Skrupellos) - Friday, 17 July 2009, 12:40 GMT-7
Last edited by Zyx (Zyx) - Sunday, 19 July 2009, 03:21 GMT-7
Task Type Bug Report
Category Compiler
Status Closed
Assigned To Zyx (Zyx)
Operating System OS-independent
Severity Low
Priority Normal
Reported Version 2.0.0
Due in Version 2.0.1
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

DESCRIPTION:
It's allowed to add only one namespace to an attribute of an tag. So if we want a namespace and the parse: it's impossible, but the compiler doesn't complain about it and generates a buggy output.


EXAMPLE:
--- template ---
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<opt:root>
<p parse:xml:lang="$lang">Witaj</p>
<!-- OK, translate.google.com helped me :) -->
</opt:root>
--- END template ---

--- script ---
$view->lang = 'pl';
--- END script ---


OUTPUT:
--- output ---
<p xml="pl">Witaj</p>
--- END output ---


EXPECTED:
Expection: Opt_XmlToManyNamespaces_Exception

And a hint in the documentation how to solve this problem, see "workaround".


WORKAROUND:
--- template ---
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<opt:root>
<p parse:xml:lang="$lang">
<opt:attribute name="xml:lang" value="$lang" />
Witaj
</p>
</opt:root>
--- END template ---
This task depends upon

Closed by  Zyx (Zyx)
Sunday, 19 July 2009, 03:21 GMT-7
Reason for closing:  Fixed
Additional comments about closing:  Fixed/implemented in rev. 156
Comment by Zyx (Zyx) - Saturday, 18 July 2009, 02:00 GMT-7
I know that there is a problem with namespaces (but not that "parse:xml:lang" is accepted by the parser :)). The plans for this part are the following:

- Since OPT 2.1.0, the "dynamic" attributes will not use the namespaces anymore to indicate this fact. It will be left for the backward compatibility, but disabled by default - see #76 for details.
- The parser will return the exception since 2.0.1
- The `opt:attribute` instruction will be given a new attribute: "namespace" since 2.0.1 (the changes will be available on SVN earlier).

Loading...