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 May 18th, 2012, 06:57 AM
Registered User
 
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!
 
Old May 18th, 2012, 07:23 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
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
 
Old May 18th, 2012, 07:36 AM
Registered User
 
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).
 
Old May 18th, 2012, 07:55 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
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
 
Old May 18th, 2012, 12:33 PM
Registered User
 
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





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





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