Subject: [xsl] Reusing XML content as I publish From: "Nicola Harlow" <Nicola.Harlow@xxxxxxxxxxxx> Date: Fri, 28 Jan 2005 14:04:46 -0000 |
Hi, I need help with an XML problem. I'm new to XML and not very technical, so please be very clear in your responses ;) Ok, I want to reuse text that I input into the XML. the output of this is HTML. I have a glossary section with glossary terms in it: <glossary> <alphagroup> <alphahead>A</alphahead> <glossaryitem name="Allocate"> <term>Allocate Stuff</term> <definition> <para>Stuff about allocations</para> </definition> </glossaryitem> </alphagroup> <alphagroup> <alphahead>C</alphahead> <glossaryitem name="Commitments"> <term>Commitments</term> <definition> <para>Text about commitments</para> </definition> </glossaryitem> Basically I want to reuse that text by getting the XML to search for the <glossaryitem>, matching the name, and then using the <term> and <definition> to create a 'tooltip': <a href="#" class="tooltip_Allocate">Allocate Stuff<span>Stuff about allocations</span></a> However, I can't work out how to identify <glossaryitem> and then get the matching <definition> text into the <span>. I DON'T want to do this on the fly; I want the tooltip created as I create the HTML ;) The tag I want to use (it would then align with my PDF output) is: <glossarytt name="Allocate" width="200">Allocate Stuff</glossarytt> The other alternative is to input each tooltip separately (waste of time, no consistency etc), or to define each tooltip in the XSL separately, then call the tooltip by name (very code-verbose, there could be 100 separate glossary terms) Does any one have any suggestions? If it's a case of 'give up' I'd rather know now than carry on getting frustrated. If you have a code sample it would be gratefully received, I'm quite good at hacking the code to fit ;) And let me apologise in advance for any terminology errors. Thanks, Nicola Nicola Harlow | Technical Author The Program Management Group www.pm-group.com
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
Re: [xsl] Output CDATA tags, David Carlisle | Thread | Re: [xsl] Reusing XML content as I , Joris Gillis |
Re: [xsl] Output CDATA tags, David Carlisle | Date | [xsl] namespace reference in xsl wi, Karjala Koponen |
Month |