473,770 Members | 5,976 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

help needed with xlink:href

Hi

Any help would be fantastic

I have a simple problem but I cant work it out... DOHH...., this is my
XML:

<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/css" href="BSI%20Tes t.css"?>
<document xmlns:xlink="ht tp://www.w3.org/1999/xlink"
xmlns:html="htt p://www.w3.org/HTML/1998/html4" xml:lang="en-US"
style="\-ilx-style-update: none; widows: 0; orphans: 0;
word-break-inside: normal; \-ilx-endnote-numbering-policy: continuous;
\-ilx-endnote-position: sectionbottom; \-ilx-endnote-style-type:
decimal; \-ilx-footnote-numbering-policy: continuous;
\-ilx-footnote-position: documentbottom; \-ilx-footnote-style-type:
decimal;\-ilx-block-border-mode: merge;">

<part>
<list>
<endnote> If this works I'll be amazed <link
xlink:href="htt p://www.weblink.com ">
<inline class="Hyperlin k">ONE</inline>
</link>
</endnote>

<endnote> If this works I'll be amazed <link
xlink:href="htt p://www.weblink.com ">
<inline class="Hyperlin k">TWO</inline>
</link>
</endnote>

<endnote> If this works I'll be amazed <link
xlink:href="htt p://www.weblink.com ">
<inline class="Hyperlin k">THREE</inline>
</link>
</endnote>
</list>
</part>
</document>
=============== =============== ===========
And this my XSL:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:styleshe et version="1.0"
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
xmlns:xlink="ht tp://www.w3.org/1999/xlink"
exclude-result-prefixes="xlink ">
<xsl:output method="xml" version="1.0" encoding="UTF-16"
indent="no"/>
<xsl:template match="document ">
<root>
<end>
<xsl:for-each select="//endnote">
<endNoteText>
<endNum>
<xsl:number level="any" format="1"/>
</endNum>
<xsl:value-of select="."/>
</endNoteText>
</xsl:for-each>
</end>
</root>
</xsl:template>
</xsl:stylesheet>

=============== =============== =======

But my output is wrong, I want the weblink to be part of the text
somthing like this:

<?xml version="1.0" encoding="UTF-16"?>
<root>
<end>
<endNoteText><e ndNum>1</endNum> If this works I'll be amazed <link
href="http://www.weblink.com ">ONE</link> </endNoteText>
<endNoteText><e ndNum>2</endNum> If this works I'll be amazed <link
href="http://www.weblink.com ">TWO</link> </endNoteText>
<endNoteText><e ndNum>3</endNum> If this works I'll be amazed <link
href="http://www.weblink.com ">THREE</link> </endNoteText>
</end>
</root>
=============== =============== ======

Jun 1 '06 #1
2 1963
On Thu, 01 Jun 2006 14:10:22 +0200, adMjb <ad***********@ gmail.com> wrote:
But my output is wrong, I want the weblink to be part of the text
somthing like this:


If you want to output elements as well, you shouldn't be using
'xsl:value-of': it only returns text.
Rather, use 'xsl:apply-templates' as much as you can:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:styleshe et version="1.0"
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
xmlns:xlink="ht tp://www.w3.org/1999/xlink"
exclude-result-prefixes="xlink ">
<xsl:output method="xml" version="1.0" encoding="UTF-16"
indent="no"/>
<xsl:template match="document ">
<root>
<end>
<xsl:for-each select="//endnote">
<endNoteText>
<endNum>
<xsl:number level="any" format="1"/>
</endNum>
<xsl:apply-templates />
</endNoteText>
</xsl:for-each>
</end>
</root>
</xsl:template>

<xsl:template match="link">
<link href="{@xlink:h ref}">
<xsl:apply-templates />
</link>
</xsl:template>
</xsl:stylesheet>
--
Joris Gillis (http://users.telenet.be/root-jg/me.html)
Veni, vidi, wiki (http://www.wikipedia.org)
Jun 2 '06 #2
Hi Joris

Many thanks for your help, that worked, fantastic, THANK YOU!!!!!
Kind Regards,
Adam

Joris Gillis wrote:
On Thu, 01 Jun 2006 14:10:22 +0200, adMjb <ad***********@ gmail.com> wrote:
But my output is wrong, I want the weblink to be part of the text
somthing like this:


If you want to output elements as well, you shouldn't be using
'xsl:value-of': it only returns text.
Rather, use 'xsl:apply-templates' as much as you can:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:styleshe et version="1.0"
xmlns:xsl="http ://www.w3.org/1999/XSL/Transform"
xmlns:xlink="ht tp://www.w3.org/1999/xlink"
exclude-result-prefixes="xlink ">
<xsl:output method="xml" version="1.0" encoding="UTF-16"
indent="no"/>
<xsl:template match="document ">
<root>
<end>
<xsl:for-each select="//endnote">
<endNoteText>
<endNum>
<xsl:number level="any" format="1"/>
</endNum>
<xsl:apply-templates />
</endNoteText>
</xsl:for-each>
</end>
</root>
</xsl:template>

<xsl:template match="link">
<link href="{@xlink:h ref}">
<xsl:apply-templates />
</link>
</xsl:template>
</xsl:stylesheet>
--
Joris Gillis (http://users.telenet.be/root-jg/me.html)
Veni, vidi, wiki (http://www.wikipedia.org)


Jun 2 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1284
by: Mike | last post by:
I need to have some links within an xml document to external pages. I have tried with the below xml and xsl documents(the proposed link has a tag called link under paragraph): XML: ---------------------------- <?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="rates.xsl"?> <rates> <pagetitle>Rates 2003/2004</pagetitle>
1
2180
by: Bernd Oninger | last post by:
As far as I know one could use other xsd schemas with the import and the xlink feature. What are the differences (beside the syntax)? Bernd
5
1657
by: Adam | last post by:
Hi, Me very confused. I have some XML that I want to convert to a more basic XML. I have put an example of what I have and what I want, I have used XSL to convert XML to HTML, but never this way. The <item numberingtext="10.01.01 "> I want in the para tag I think, but if it has to be it own tag, no worrys. Any help would be fantastic Example of what I have:
1
1901
by: Lothar Lemnitzer | last post by:
Dear fellows, I have a problem with matching namespaces in an XML document and an XSLT stylesheet (at least I think that this is the source of trouble). My XML document looks like this: 1 <?xml version="1.0" encoding="ISO-8859-1" standalone="no"?> 2 <!DOCTYPE relations SYSTEM "germanet_relations.dtd"> 3 <relations>
4
4002
by: Lance Dyas | last post by:
I have managed to get the xml to load using the xmlHTTPrequest... (inspite of premature readyState 4) the problem now arises in Safari alone... var thelink = node.getAttribute("xlink:href") Works in other browsers... except Safari, where it always returns null Any ideas?
4
4764
by: jvanulden | last post by:
Hello all, I am having difficulty figuring out how to create an XmlElement and giving it an attribute that requires a namespace. Here is what I have so far which throws an exception because you can't have a : in an attribute name??? XmlElement eOnlineResource = m_context.CreateElement("OnlineResource"); eOnlineResource.SetAttribute("xlink:href", "http://www.w3c.org/1999/xlink", sldUrl);
4
2899
by: Martin | last post by:
Hello I'm trying to learn xlink/xpointer (with no success so far :-( I would like to produce the following output. AAAA BBBB CCCC AAAA
1
1659
by: kaye80 | last post by:
I have an XML and XSL document. I am trying to incorporate hyperlinks throughout the XML document. I have read many of the related posts on this and other forums but I can't seem to get it right. Please help! Do I have to declare the namespace in the XSL doc also as shown below or should I take it out? No matter what I do, nothing appears for the link tag in the browser. a piece of my xml DOC (using google for now as an easy example but...
9
3573
by: jayvi | last post by:
I used this code inside of a javascript file to switch out an 'add to cart' button: var addDisplay = document.getElementById('cart-add'); addDisplay.innerHTML = "<a class='item_add' href='javascript:;'><img src='images/shop/cart-add.jpg' width='118' height='26' border='0'></a>"; the original 'add to cart' button that is in the htm file works, but when it is switched out with the one above, it does not work! what am I doing wrong? it's...
0
9592
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10058
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10004
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9870
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8886
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7416
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5313
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
3576
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2817
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.