Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old July 31st, 2006, 07:26 PM
Friend of Wrox
Points: 1,676, Level: 16
Points: 1,676, Level: 16 Points: 1,676, Level: 16 Points: 1,676, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2006
Location: , , .
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default 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

Reply With Quote
  #2 (permalink)  
Old July 31st, 2006, 11:58 PM
Friend of Wrox
 
Join Date: Jun 2004
Location: Chennai, Tamil Nadu, India.
Posts: 449
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to r_ganesh76
Default

what do you mean by hiding?

Regards
Ganesh
http://ganeshprof.blogspot.com
Reply With Quote
  #3 (permalink)  
Old August 1st, 2006, 03:29 AM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

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
Reply With Quote
  #4 (permalink)  
Old August 1st, 2006, 05:40 AM
Friend of Wrox
Points: 1,676, Level: 16
Points: 1,676, Level: 16 Points: 1,676, Level: 16 Points: 1,676, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2006
Location: , , .
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default

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
Reply With Quote
  #5 (permalink)  
Old August 1st, 2006, 06:20 AM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

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
Reply With Quote
  #6 (permalink)  
Old August 1st, 2006, 08:15 AM
Friend of Wrox
Points: 1,676, Level: 16
Points: 1,676, Level: 16 Points: 1,676, Level: 16 Points: 1,676, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2006
Location: , , .
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default

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.
Reply With Quote
  #7 (permalink)  
Old August 1st, 2006, 08:50 AM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

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
Reply With Quote
  #8 (permalink)  
Old August 1st, 2006, 09:59 AM
Friend of Wrox
Points: 1,676, Level: 16
Points: 1,676, Level: 16 Points: 1,676, Level: 16 Points: 1,676, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2006
Location: , , .
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default

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



Reply With Quote
  #9 (permalink)  
Old August 1st, 2006, 10:12 AM
mhkay's Avatar
Wrox Author
Points: 18,487, Level: 59
Points: 18,487, Level: 59 Points: 18,487, Level: 59 Points: 18,487, Level: 59
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

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
Reply With Quote
  #10 (permalink)  
Old August 1st, 2006, 11:39 AM
Friend of Wrox
Points: 1,676, Level: 16
Points: 1,676, Level: 16 Points: 1,676, Level: 16 Points: 1,676, Level: 16
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jul 2006
Location: , , .
Posts: 430
Thanks: 28
Thanked 5 Times in 5 Posts
Send a message via Yahoo to bonekrusher
Default

Thanks for the help.

Bones


Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


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



All times are GMT -4. The time now is 10:58 AM.


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