 |
| 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
|
|
|
|

July 31st, 2006, 07:26 PM
|
|
Friend of Wrox
|
|
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
|
|
Use but Hide Attribute
Hi all,
How do I hide this line
<xsl:value-of select="@id" />
but use its value in the html output?
Code:
<xsl:template match="JBU:indexterm">
- <a>
- <xsl:attribute name="name">
<xsl:value-of select="@name" />
</xsl:attribute>
<xsl:value-of select="@id" />
</a>
</xsl:template>
Thanks
|
|

July 31st, 2006, 11:58 PM
|
|
Friend of Wrox
|
|
Join Date: Jun 2004
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
|
|
what do you mean by hiding?
Regards
Ganesh
http://ganeshprof.blogspot.com
|
|

August 1st, 2006, 03:29 AM
|
 |
Wrox Author
|
|
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
|
|
I don't know what you mean. What HTML output are you trying to generate?
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
|
|

August 1st, 2006, 05:40 AM
|
|
Friend of Wrox
|
|
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
|
|
Hi All,
The xslt codes spitz out this in HTML:
Code:
</a><p><a name="blue">Blueprint</a>
the browser view looks like this:
Code:
BlueprintFrom the very beginning, our goal
I want to hide the word "Blueprint" which is derived from
Code:
<xsl:value-of select="@id" />
I only want to use "blue"(@name) as an anchor and "Blueprint" (@id) as a Index reference later on, but not see it in the HTML output.
I hope this helps.
Thx
Bones
|
|

August 1st, 2006, 06:20 AM
|
 |
Wrox Author
|
|
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
|
|
You've already got code to output the name attribute:
<xsl:attribute name="name">
<xsl:value-of select="@name" />
</xsl:attribute>
Just do the same with the id attribute:
<xsl:attribute name="name">
<xsl:value-of select="@id" />
</xsl:attribute>
or for brevity just do
<xsl:copy-of select="@name|@id"/>
I'm having trouble seeing where your difficulty lies.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
|
|

August 1st, 2006, 08:15 AM
|
|
Friend of Wrox
|
|
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
|
|
Thanks, I try your suggestions.
The Difficulty lies in the @id in the output, but I need it for creating the index.
Ideally this:
"BlueprintFrom the very beginning, our goal"
Should be:
"From the very beginning, our goal"
"Blueprint" is the bookmark, but I dont want to see it in the output.
|
|

August 1st, 2006, 08:50 AM
|
 |
Wrox Author
|
|
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
|
|
Do you actually know what HTML "source" you want to generate? If so, show us. If not, then don't start trying to write XSLT code - you should never write a program if you don't what output you want to produce.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
|
|

August 1st, 2006, 09:59 AM
|
|
Friend of Wrox
|
|
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
|
|
I dont think I am explaining correctly.
I know its in laymenâs, so please forgive me. I am trying to learn XSLT.
this is how it outputs now
Code:
</a><p><a name="blue">Blueprint</a>From the very beginning, our goal has blah blah etc..<p>
but I want to hide in the output the >Blueprint< because it is a bookmark not part of the text...
|
|

August 1st, 2006, 10:12 AM
|
 |
Wrox Author
|
|
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
|
|
If all you want to do is to leave out the text that says "Blueprint", then just leave out the <xsl:value-of> instruction that writes this text.
Michael Kay
http://www.saxonica.com/
Author, XSLT Programmer's Reference and XPath 2.0 Programmer's Reference
|
|

August 1st, 2006, 11:39 AM
|
|
Friend of Wrox
|
|
Join Date: Jul 2006
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
|
|
Thanks for the help.
Bones
|
|
 |