oulan / iui

Automatically exported from code.google.com/p/iui
MIT License
0 stars 0 forks source link

Use of "selected" tag for "<ul>" elements is a problem when trying to generate iui compatible pages with xslt #190

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I'm no xsl expert, but....

Use of "selected" tag for "<ul>" elements is a problem when trying to generate 
iui compatible 
pages with xslt

The problem is likely a bug in xtltproc/libxml/libxslt but it is easy to work 
around in iui and I'd 
like to suggest a change to the "selected" attribute that is required by the ul 
tag (among others?) 
for iui to function.

The fix is to change "selected" to "iui_selected" in all the .js and .css files

Try to generate a simple iui page from xml using xsl:

...
<ul>
    <xsl:attribute name="selected">true</xsl:attribute>
    <xsl:attribute name="id">home</xsl:attribute>
    <xsl:attribute name="title">Test Title</xsl:attribute>
    <xsl:apply-templates select="package/items" />
</ul>

produces:

<ul selected id="home" title="Test Title">

for the ul node.  Note that it failed to even product a valid attribute.  
Changing the value "true" to 
"hello" does not solve the problem.

if I change "select" to "iui_selected" and update all the iui .js / .css iui 
files the same way, then:

<ul>
    <xsl:attribute name="iui_selected">true</xsl:attribute>
    <xsl:attribute name="id">home</xsl:attribute>
    <xsl:attribute name="title">Test Title</xsl:attribute>
    <xsl:apply-templates select="package/items" />
</ul>

produces:

<ul iui_selected="true" id="home" title="Test Title">

which works.

What version of the product are you using? On what operating system?

0.31, Mac OS X 10.5.8

Please provide any additional information below.

The version of xsltproc and related libraries are:

prompt$xsltproc --version

Using libxml 20702, libxslt 10124 and libexslt 813
xsltproc was compiled against libxml 20702, libxslt 10124 and libexslt 813
libxslt 10124 was compiled against libxml 20702
libexslt 813 was compiled against libxml 20702

I've attached a .tgz file containing the xml, xsl, sample output (html) and 
edited iui files in case 
that helps.

the command to use xsltproc to generate this is:

xsltproc -o bugtest.html bugtest.xsl bugtest.xml

then open bugtest.html in safari

I hope the the tags and such above don't get munged... never entered a bug here 
before.

Original issue reported on code.google.com by haik...@gmail.com on 3 Nov 2009 at 10:00

GoogleCodeExporter commented 9 years ago
I've used xslt some time ago and the selected tag worked for me with iUI.
I checked the template and found this one in the header:

<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" indent="no" omit-xml-declaration="yes" 
encoding="UTF-8"/>

Give it a try, otherwise I would say its xsltproc related.

Cheers
Max

Original comment by melcher....@gmail.com on 4 Nov 2009 at 6:01

GoogleCodeExporter commented 9 years ago
Thanks for the reply.  I tried putting in the header you said (which wasn't 
that different from what I had) and it 
did not fix the problem.  

I realized that the archive I had attached initially was the _fixed_ version 
wherein I'd changed all the "selected" 
to "iui_selected".  The one I've attached now is the stock iui files and the 
xsl that uses "selected".  It is 100% 
reproducible on my machine.  (file bugtest2.tgz).

xsltproc is really just a thin wrapper on libxml and libxslt so I don't think 
it's in there.  Likely a libxslt or 
libxml issue.  I still vote for changing it in iui since it's a trivial change 
that works around a basic reproducible 
bug in some standard library (libxslt or libxml).

Original comment by haik...@gmail.com on 5 Nov 2009 at 8:23

Attachments:

GoogleCodeExporter commented 9 years ago
the problem is fixed by using method="xml" in the xsl:output

Original comment by rikkertk...@gmail.com on 3 Jan 2010 at 12:11

GoogleCodeExporter commented 9 years ago
Thanks.  Unfortunately, I need to output html, not xml.  

It seems likely that iui is being used for web pages that are wanting to be 
html (html5 soon enough).

This still would like to be actually fixed by changing "selected" to something 
less generic, e.g., "iui_selected"

Original comment by haik...@gmail.com on 3 Jan 2010 at 6:23

GoogleCodeExporter commented 9 years ago
Isn't xml and html syntax mostly the same? I think you can generate valid html 
with
the xml mode.

One thing that might be tricky is empty tags. I found out that browsers are 
sometimes
very picky about how tags are closed. I had problems with some <input> if I 
remember
correctly: if I wrote them as <input/> the rest of my form was messed up. But 
you'd
have to try that.

Original comment by hendrik@van-antwerpen.net on 4 Jan 2010 at 10:16

GoogleCodeExporter commented 9 years ago
O yes, I forgot. Changing the selected attribute would break all existing
applications (at least built against 0.4 versions). This should not be done 
lightly I
think.

Original comment by hendrik@van-antwerpen.net on 4 Jan 2010 at 10:17

GoogleCodeExporter commented 9 years ago
It's a pretty trivial change to make to an existing app, seems to me.  A quick 
search and replace.  But I don't have 
a big code base of iui stuff so maybe I'm not seeing the impact.

Original comment by haik...@gmail.com on 4 Jan 2010 at 4:36

GoogleCodeExporter commented 9 years ago
@haikusw Can you include your own CSS file after iui.css that makes it 
iui_selected work?  Or does it require JS 
changes as  well?

We are very reluctant to make breaking changes that require thousands of iUI 
users to change their  pages.

Original comment by msgilli...@gmail.com on 5 Jan 2010 at 5:51

GoogleCodeExporter commented 9 years ago
Good idea.  I don't know the answer; I'm relatively new to this CSS/Javascript 
etc stuff.  Someone who knows 
more might be able to do something like you suggest.  If there were some way to 
alias one attribute name to 
another that would do it, but I don't know how to do that in CSS.

The change I made to work around it involved CSS and JS changes inside iui 
though.  

I provided simple samples attached to this ticket - first one has the changed 
iui, second one uses stock iui 
and shows the problem.

thanks.

Original comment by haik...@gmail.com on 5 Jan 2010 at 7:13

GoogleCodeExporter commented 9 years ago
As far as I can see, changes to both CSS and JS are needed.

You could change the js and css to support both methods. But it will probably 
break
applications which deal with the selected attribute in their own code.

Original comment by hendrik@van-antwerpen.net on 6 Jan 2010 at 10:12

GoogleCodeExporter commented 9 years ago
Here's a change that I made to address this issue that is a candidate for 
pulling in to the main release:
http://code.google.com/r/msgilligan-iui-angular/source/detail?r=5df60ddd399c6e58
961ff160b3ab57b7751a7421&name=msgilligan-angularjs-test

Original comment by msgilli...@gmail.com on 3 Apr 2012 at 10:04

GoogleCodeExporter commented 9 years ago
This can be considered a duplicate of Issue #15.

Original comment by msgilli...@gmail.com on 3 Apr 2012 at 10:07