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 | Calendar | 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 May 18th, 2012, 06:57 AM
Registered User
Points: 30, Level: 1
Points: 30, Level: 1 Points: 30, Level: 1 Points: 30, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2012
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default using hyperlinks in style sheet

Hiya,

can i please get some advice or guidance on how i can use hyperlinks in my xslt style sheet to help navigate or explore my xml data quicker please? What is the syntax or is there an example i could follow?

my xml simply contains following:

<people>
<person id="001">
<name>blah blah.....</name>
<address>......</address>
<dob>.....</dob>
<profession>........</profession>
<group membership>001</group membership>
</person>
<groups>
<group id="001" />
<group name>chess</group name>
</groups>
</people>

i want to extend my style sheet to include hyperlinks so that rather than having multiple persons in my xml data above be outputted consecutively, i want to use hyperlinks so that you can e.g. click on person id or person name that drops you to area on same page where you can view full details of that person...

many thanks!
Reply With Quote
  #2 (permalink)  
Old May 18th, 2012, 07:23 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

Is the output of your stylesheet HTML? In that case, you generate anchor elements (<a href=""> and <a name="">) in the same way as any other HTML elements in your output.

A stylesheet is just a transformation from XML to HTML. Before you can write it, you need to know what HTML you want to generate.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
Reply With Quote
  #3 (permalink)  
Old May 18th, 2012, 07:36 AM
Registered User
Points: 30, Level: 1
Points: 30, Level: 1 Points: 30, Level: 1 Points: 30, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2012
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

many thanks for reply,

ok yes i want to render my xml as just regular html with hyperlinks......however, problem is rendering links that actually produce some result; I’m just not sure how to do that part?

P.S. im using oxygen tool to create my xsl files, in the transformation menu, the output tab only has options to show as: XHTML, XML and SVG - how do i output just normal html? (sorry for the basic question as im new to the tool).
Reply With Quote
  #4 (permalink)  
Old May 18th, 2012, 07:55 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 know what HTML you want your transformation to produce? If so, show us an example.

If you don't know what HTML you want to produce, then don't even think about the XSLT code for generating it. Never start writing a program until you know what output is required. And if you need help designing the HTML, find an HTML forum not an XSLT forum to get help.

If you problem is with using the oXygen tool to produce your transformation, then you should be asking on an oXygen forum.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
Reply With Quote
  #5 (permalink)  
Old May 18th, 2012, 12:33 PM
Registered User
Points: 30, Level: 1
Points: 30, Level: 1 Points: 30, Level: 1 Points: 30, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: May 2012
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

hiya,

what i want the html to produce is to have maybe the person id or person name act as a hyperlink which to click on and then that takes you away to the specific details of that selected person - but target reference will not be some external web page, it needs to land you on same document, hope that makes sense.

so steps are:

1. produce html
2. user clicks person hyperlink
3. some processing in xslt
4. user lands on area with person details displayed
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
Style Sheet Blues Gudni BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 1 December 10th, 2010 03:06 PM
Style Sheet File dotnetDeveloper BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 4 April 23rd, 2010 11:18 AM
Need to redirect XML outputted by style sheet back into same style sheet Kenneth.Dougherty XSLT 4 November 9th, 2009 04:29 PM
Style Sheet exit veera_clr XSLT 3 November 9th, 2009 07:04 AM
hyperlinks style scrowler CSS Cascading Style Sheets 8 January 20th, 2005 09:13 AM



All times are GMT -4. The time now is 04:45 PM.


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