Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 1st, 2006, 06:18 PM
Authorized User
 
Join Date: Nov 2004
Posts: 81
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via ICQ to jkmyoung
Default

<xsl:template match="JBU:indexterm">
<a name="{@name}" id="{@id}"/>
</xsl:template>


 
Old August 2nd, 2006, 06:38 AM
Friend of Wrox
 
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default

Thanks for the help, but its not what I am looking for. All suggestions posted spit out this:
Code:
</a><p><a name="blue" id="Blueprint"></a>
I need it to look like this:

Code:
</a><p><a name="blue">Blueprint</a>
My orginal code does this but >Blueprint< shows up as text, I want it to be hidden. Maybe I am trying to do something it cant. Anyway thanks for all the help

Bones



 
Old August 2nd, 2006, 06:49 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

You need to decide what the output must look like, e.g. do you want:[code]
<a name="blue"><span style="display:none">Blueprint</span></a>
[code]
For that you need:
Code:
<xsl:template match="JBU:indexterm">
  <a name="{@name}">"><span style="display:none"><xsl:value-of select="{@id}"/></span></a>
</xsl:template>
There seems little point in having this but I know people often get strange requirements...

--

Joe (Microsoft MVP - XML)
 
Old August 2nd, 2006, 06:53 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

If you generate

<a name="blue">Blueprint</a>

then it won't be hidden. If you want it to be hidden then you need to generate something different, for example a CSS style attribute.

You seem to be terribly confused. As I said before, decide first what HTML you want to generate. Do a mockup of the HTML page until you get what you want. Then start writing the XSLT code to produce this page.

Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
 
Old August 2nd, 2006, 08:23 AM
Friend of Wrox
 
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default

Joe,

Thats was it!

Code:
<xsl:template match="JBU:indexterm">
        <a>
            <span style="display:none; ">
                <xsl:attribute name="name"><xsl:value-of select="@name"/></xsl:attribute>
                <xsl:value-of select="@id"/>
            </span>
        </a>


Thanks for everyones help!





Similar Threads
Thread Thread Starter Forum Replies Last Post
Replace an attribute with another attribute georgemeng XSLT 8 June 10th, 2008 11:04 AM
Hide file phuc2583 Classic ASP Basics 1 January 14th, 2008 03:58 AM
Access to attribute values from class of attribute jacob C# 1 October 28th, 2005 01:11 PM
how can I hide my combobox? Shelly Javascript How-To 3 August 30th, 2003 09:59 PM
How to Hide Folder in C# manoj241176 VS.NET 2002/2003 0 July 29th, 2003 04:10 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.