Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
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 Display Modes
  #1 (permalink)  
Old February 17th, 2009, 01:18 PM
Registered User
 
Join Date: Feb 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default create links using XSL

I have following types XML Data:


<PAGE METAKEY="9781934043769" LABEL="146">
<INDENTPARA>There is no shortage of histor...</INDENTPARA>
...
</PAGE>

....
....
<INDEXITEM1><INDEXITEMCONTENT>industrial schools,</INDEXITEMCONTENT> <INDEXITEMPAGE METAKEY="9781934043769" LABEL="8">8</INDEXITEMPAGE> <INDEXITEMPAGE METAKEY="9781934043769" LABEL="128">128</INDEXITEMPAGE> <INDEXITEMPAGE METAKEY="9781934043769" LABEL="146">146</INDEXITEMPAGE></INDEXITEM1>


What i want to do is to create a link between these attribute values(attribute values are actually page numbers) using XSL.

style sheet namespace i am follow is the following:

<xsl:stylesheet xmlns:xsl="......TR/WD-xsl>


Thanks in advance..

Last edited by prashob_2; February 17th, 2009 at 01:20 PM.
Reply With Quote
  #2 (permalink)  
Old February 17th, 2009, 01:30 PM
mhkay's Avatar
Wrox Author
Points: 18,438, Level: 59
Points: 18,438, Level: 59 Points: 18,438, Level: 59 Points: 18,438, Level: 59
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Apr 2004
Location: Reading, Berks, United Kingdom.
Posts: 4,954
Thanks: 0
Thanked 290 Times in 285 Posts
Default

The WD-xsl language has been obsolete for over ten years now, and information on it is very hard to find - I doubt you will get any help with it here.

But apart from that, I don't really understand your requirement. Please show the XML or HTML output that you want to produce.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference
Reply With Quote
  #3 (permalink)  
Old February 17th, 2009, 01:32 PM
Friend of Wrox
Points: 6,673, Level: 34
Points: 6,673, Level: 34 Points: 6,673, Level: 34 Points: 6,673, Level: 34
Activity: 100%
Activity: 100% Activity: 100% Activity: 100%
 
Join Date: Nov 2007
Location: Germany
Posts: 1,242
Thanks: 0
Thanked 244 Times in 243 Posts
Default

First of all the XSLT 1.0 and 2.0 namespace is http://www.w3.org/1999/XSL/Transform. If you use a different namespace then I am afraid you are not trying to use XSLT but rather an old predecessor of XSLT that is only implemented by MSXML 3 or earlier and nowadays not even used anymore.

As for your transformation question, what exactly do you want to achieve? Do you want to transform that XML to HTML and create HTML links? Or what kind of link exactly do you want to create?
Provide a sample of the output you want the XSLT stylesheet to create from the input you posted.
__________________
Martin Honnen
Microsoft MVP (XML, Data Platform Development) 2005/04 - 2013/03
My blog
Reply With Quote
  #4 (permalink)  
Old February 17th, 2009, 10:24 PM
Registered User
 
Join Date: Feb 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

i had make try with namespace http://www.w3.org/1999/XSL/Transform also. We want to display the html output of xml file. In this html we have cross-refer the id's.

Martin Honnen guess the exact requirement.
Reply With Quote
  #5 (permalink)  
Old February 18th, 2009, 12:11 AM
Friend of Wrox
Points: 1,306, Level: 14
Points: 1,306, Level: 14 Points: 1,306, Level: 14 Points: 1,306, Level: 14
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2008
Location: Pondicherry, India
Posts: 291
Thanks: 9
Thanked 29 Times in 29 Posts
Thumbs up

Try this:

Code:
 
<xsl:template match="PAGE">
<a>
<xsl:attribute name="name">
<xsl:value-of select="@LABEL"></xsl:value-of>
</xsl:attribute>
</a>
<p><xsl:value-of select="INDENTPARA"></xsl:value-of></p>
</xsl:template>

<xsl:template match="INDENTPARA"></xsl:template>

<xsl:template match="INDEXITEMPAGE">
<a>
<xsl:attribute name="href">#<xsl:value-of select="@LABEL"></xsl:value-of></xsl:attribute>
<xsl:value-of select="."></xsl:value-of>
</a>
</xsl:template>


You should post the input and required output correctly. Only then you could get a solution. Your question is not clear much.
__________________
Rummy
Reply With Quote
  #6 (permalink)  
Old February 18th, 2009, 07:22 AM
Registered User
 
Join Date: Feb 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What i need is to create an HTML output of my XML files using XSL..

Here in XML

<PAGE METAKEY="9781934043769" LABEL="146">
<INDENTPARA>There is no shortage of histor...</INDENTPARA>
...
</PAGE>
....
<INDEXITEM1><INDEXITEMCONTENT>industrial schools,</INDEXITEMCONTENT> <INDEXITEMPAGE METAKEY="9781934043769" LABEL="8">8</INDEXITEMPAGE> <INDEXITEMPAGE METAKEY="9781934043769" LABEL="128">128</INDEXITEMPAGE> <INDEXITEMPAGE METAKEY="9781934043769" LABEL="146">146</INDEXITEMPAGE></INDEXITEM1>

here INDEXITEM is a glossary

The attributes "LABEL" is referring to the page numbers.

What i want is to create an internal link between these to attribute values...so that i should be able to toggle between glossary items and the actual text.

The code provided by mrame is not working..

I hope what i explained is ok...

Thanks a lot in advance..
Reply With Quote
  #7 (permalink)  
Old February 18th, 2009, 07:24 AM
Registered User
 
Join Date: Feb 2009
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default

What i need is to create an HTML output of my XML files using XSL..

Here in XML

Code:
<PAGE METAKEY="9781934043769" LABEL="146">
<INDENTPARA>There is no shortage of histor...</INDENTPARA>
...
</PAGE>
....
<INDEXITEM1><INDEXITEMCONTENT>industrial schools,</INDEXITEMCONTENT> <INDEXITEMPAGE METAKEY="9781934043769" LABEL="8">8</INDEXITEMPAGE> <INDEXITEMPAGE METAKEY="9781934043769" LABEL="128">128</INDEXITEMPAGE> <INDEXITEMPAGE METAKEY="9781934043769" LABEL="146">146</INDEXITEMPAGE></INDEXITEM1>
here INDEXITEM is a glossary

The attributes "LABEL" is referring to the page numbers.

What i want is to create an internal link between these to attribute values...so that i should be able to toggle between glossary items and the actual text.

The code provided by mrame is not working..

I hope what i explained is ok...

Thanks a lot in advance..
Reply With Quote
  #8 (permalink)  
Old February 18th, 2009, 07:32 AM
Friend of Wrox
Points: 1,306, Level: 14
Points: 1,306, Level: 14 Points: 1,306, Level: 14 Points: 1,306, Level: 14
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2008
Location: Pondicherry, India
Posts: 291
Thanks: 9
Thanked 29 Times in 29 Posts
Thumbs up

Even after repeated requests you are not posting the required output html for your input xml. Ok. Atleast post the incorrect html output obtained from my code and ask for the correct one you need. Then only you can get a solution.
__________________
Rummy
Reply With Quote
Reply


Thread Tools
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
Create generic XSL Template to create table Venkatachalapathy XSLT 5 March 11th, 2008 08:49 AM
xsl links to target iframe dragonkeeper XSLT 1 August 10th, 2006 01:28 PM
How to create Dynamic Text in xsl NewToXSL XSLT 3 June 8th, 2006 06:26 PM
create xsl file in c directory keyvanjan Classic ASP Basics 2 June 21st, 2005 05:52 PM
How to Create Links to Word Document frm Reports sundarakshi Crystal Reports 0 November 6th, 2004 02:19 AM



All times are GMT -4. The time now is 11:47 PM.


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