xsl-list
[Top] [All Lists]

Re: [xsl] Generating a <div>-toggling ID as a variable

2017-01-08 23:55:31
On Mon, Jan 09, 2017 at 05:32:51AM -0000, Charles Muller 
acmuller(_at_)l(_dot_)u-tokyo(_dot_)ac(_dot_)jp scripsit:
Writing the javascript and HTML code to toggle one section based on a <div>
ID is no problem, but in order for each <hom> section of each of the many
<entry(s)> in the dictionary to be toggled individually, each one would need
its own separate ID to be generated. I've spent a couple of hours
researching this, and from what I've found, I'm not sure if it's possible.
....
So the crux of the matter seems to be whether the 'myDIV' that is used in
the Javascript function, which appears as the <div id> below, can be turned
into a variable that will function separately for each entry. Does anyone
know if this is possible?

I'm unsure why a pre-pass to run generate-id() to create an id attribute
for each hom element wouldn't work?

There are other ways to approach this (you can synthesize an ID from the
contents), but I'd think the easy way would be to use generate-id() and
feed that version of the XML document into the rest of the process.

It's quite possible I'm missing something.

-- Graydon
--~----------------------------------------------------------------
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
EasyUnsubscribe: http://lists.mulberrytech.com/unsub/xsl-list/1167547
or by email: xsl-list-unsub(_at_)lists(_dot_)mulberrytech(_dot_)com
--~--

<Prev in Thread] Current Thread [Next in Thread>