xsl-list
[Top] [All Lists]

Re: [xsl] dangling attribute creation (was Re: [xsl] When to use text())

2014-04-27 01:54:06
On Sun, 2014-04-27 at 06:24 +0100, Ihe Onwuka wrote:
[...]
Supposed to be a link to Sal Mangano's Cookbook. Recipe 8.2 How else
are you supposed to convert elements to attributes?

http://books.google.co.uk/books?id=67NUlLjGvtoC&pg=PT294&lpg=PT294&dq=sal+mangano+xslt+cookbook+elements+to+attributes&source=bl&ots=23V9HCp4xJ&sig=SQkTBEZkXVhPqC4NWfNY8NuMhlE&hl=en&sa=X&ei=XJNcU7iOE8e3PM-MgOgO&ved=0CGcQ6AEwBg#v=onepage&q=sal%20mangano%20xslt%20cookbook%20elements%20to%20attributes&f=false

That gives me a message about having exceeded my previewing limit.
Like youtube or google play or those music sites, "content not available
in your country".

Elements to attributes - in general it's lossy, but yes, that's a
reasonable case for templates that return attributes. Functions that
return attributes might be easier to work with, though, or templates
that return strings, plus a helper function that creates an attribute
only if a string is not empty.

Careful use of as= can help reduce problems.

Liam

-- 
Liam Quin - XML Activity Lead, W3C, http://www.w3.org/People/Quin/
Pictures from old books: http://fromoldbooks.org/
Ankh: irc.sorcery.net irc.gnome.org freenode/#xml


--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--