473,396 Members | 1,706 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

how to insert a hyperlink in XSLT

I have the following piece of code used to map data from one AJAX form to another. However the output of the mapping has extra namespaces in it. how would I correct the XSL to have the correct output?

i expect to receive:

Expand|Select|Wrap|Line Numbers
  1. <a href="http://server:9090/doc.pdf">copy of doc</a>
instead I receive:

Expand|Select|Wrap|Line Numbers
  1. <a xmlns:xs="http://www.w3.org/2001/XMLschema" xmlns:gi="http://www.myplace.com/gi/AJAXForms/List1.gi" href="http://server:9090/doc.pdf">copy of doc</a>
this is the piece of code I use:

Expand|Select|Wrap|Line Numbers
  1. <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  2.     xmlns:xs="http://www.w3.org/2001/XMLschema" version="2.0">
  3.     <xsl:output method="xml" omit-xml-declaration="yes" />
  4.  
  5.     <xsl:template match="gi:FormModel" xmlns:gi="http://www.myplace.com/gi/AJAXForms/List1.gi">
  6.         <xsl:element name="List-field2">
  7.             <xsl:for-each select="List-field1/List1-matrix">
  8.                 <xsl:variable name="position" select="position()" />
  9.                 <xsl:element name="ShortList2-matrix">
  10.                     <xsl:element name="doc-map">
  11.                         <link href="{//*[local-name()=concat('doc',$position,'-upload')]}">Copy of doc</link>
  12.                     </xsl:element>
  13.                 </xsl:element>
  14.             </xsl:for-each>
  15.         </xsl:element>
  16.     </xsl:template>
  17.  
  18. </xsl:stylesheet>
Jan 28 '10 #1

✓ answered by Dormilich

use the exclude-result-prefixes attribute in <xsl:stylesheet>

3 5196
Dormilich
8,658 Expert Mod 8TB
use the exclude-result-prefixes attribute in <xsl:stylesheet>
Jan 28 '10 #2
Thanks a million. It has brought me one step closer to my goal.

Now that I have the output as <a href='xxx.xx'</a> how would I code the XSL to change the output so that I get &lt;a href='xxx.xxx'&lt;/a&gt;

Also you ask me to use code tags when posting code - I have no idea how to do this. I am new to this and would appreciate your guidance.

Thanks
Manesh
Jan 29 '10 #3
Dormilich
8,658 Expert Mod 8TB
Now that I have the output as <a href='xxx.xx'</a> how would I code the XSL to change the output so that I get &lt;a href='xxx.xxx'&lt;/a&gt;
return it as <xsl:text>. you can’t do that with <xsl:element>.

Also you ask me to use code tags when posting code - I have no idea how to do this. I am new to this and would appreciate your guidance.
either type [code] before and [/code] after your code or use the # button (rightmost of the buttons) in the editor (advanced mode)
Jan 29 '10 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Randi | last post by:
Hi all, I there any way of putting an html hyperlink into a .xml file, and still be able to use the xml tags to format the page? Here is the code of the xml file(real simple) and the .css file. ...
3
by: Michael Hertz | last post by:
I am performing a XSLT stylesheet on a XML document and produce a new XML document. How can I insert in this new XML stylesheet a tag <currtime>..."the current date/time"....</currtime> where...
3
by: kk | last post by:
I have an xml file and write an xslt. Now I want to insert related elements from xslt to db directly for various data types. How can I do? Is there any existing tool for this? Thanks!
6
by: KL | last post by:
I am totally new to XML and confused as heck. I have my xml file and want one of my elements to be a website. Heck I even named the element website (I know real original), but I can't make the...
0
by: Mike | last post by:
I noticed from the msdn help that posting a large message to the event log is a bad practice. Logging a path to a file is better in this instance. Is it possible to send a hyperlink in an event log...
9
by: Peter Afonin | last post by:
Hello, I created an e-mail form pretty much as described in this article: http://www.4guysfromrolla.com/webtech/080801-1.shtml. It works great, but I cannot figure out one thing: I need to...
1
by: Newbie | last post by:
Hello I need some help to make a hyperlink in a XML file. My XML file: <?xml version="1.0" encoding="ISO-8859-1"?> <TERAPEUTLISTE> <TERAPEUT> <NAVN>Et navn</NAVN> <ADRESSEN>En...
2
by: jkflens | last post by:
Hello, i convert one XML-document by using XSLT into another XML-document. First change all attributes to elements is no problem. Then i try to insert a new element into the new document by...
4
by: mark4asp | last post by:
I want to write a xslt template to create a xhtml 1.0 (transitional) file which will be sent in as email. Here is a typical xml data file: <BatchEmail> <Domain>www.myDomain.com</Domain>...
2
by: adamace5o | last post by:
When i try to use post variables with php and mysql i can't get the insert into statement to accept varibles as values. If i use 'test' instead of $test it does work. I suspect it is something to do...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
0
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,...

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.