Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
| 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 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 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..
 
Old February 17th, 2009, 01:30 PM
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

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
 
Old February 17th, 2009, 01:32 PM
Friend of Wrox
Points: 6,676, Level: 34
Points: 6,676, Level: 34 Points: 6,676, Level: 34 Points: 6,676, Level: 34
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Nov 2007
Location: Germany
Posts: 1,243
Thanks: 0
Thanked 245 Times in 244 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
 
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.
 
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
 
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..
 
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..
 
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




Similar Threads
Thread Thread Starter Forum Replies Last Post
Create generic XSL Template to create table Venkatachalapathy XSLT 5 March 11th, 2008 07:49 AM
xsl links to target iframe dragonkeeper XSLT 1 August 10th, 2006 12:28 PM
How to create Dynamic Text in xsl NewToXSL XSLT 3 June 8th, 2006 05:26 PM
create xsl file in c directory keyvanjan Classic ASP Basics 2 June 21st, 2005 04:52 PM
How to Create Links to Word Document frm Reports sundarakshi Crystal Reports 0 November 6th, 2004 02:19 AM





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