473,668 Members | 2,371 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

XSLT Transform in .net, xsl:element attributes not generated

Hi all, Just wonder anyone have encountered this problem before?I tried using XMLSPY debugger and I can get the correct outputfor my XSLT transformation, however in .net, aftertransforma tion the attributes I put inside xsl:element tagcannot be generated.

Part of the XML data:
<?xml version="1.0" encoding="utf-8"?>
<receipients>
<receipient>
...
<ServerUrl>http ://win2003p2/</ServerUrl>
<SubmissionUrl> http://win2003p2/online+feedback .htm</SubmissionUrl>
...
</receipient>
</receipients>

Part of the XSLT data:
<xsl:element name="form">
<xsl:attribut e name="method">p ost</xsl:attribute>
<xsl:attribut e name="target">_ blank</xsl:attribute>
<xsl:attribut e name="action">< xsl:value-ofselect="Submi ssionUrl"/></xsl:attribute>
<table border="0" cellpadding="0" cellspacing="0" >
<tr><td width="1" align="left" valign="top">
<xsl:element name="img">
<xsl:attribut e name="src"><xsl :value-ofselect="Serve rUrl"/>Images/cornerTL.gif</xsl:attribute>
<xsl:attribut e name="width">7</xsl:attribute>
<xsl:attribut e name="height">7 </xsl:attribute>
</xsl:element></td>
<td rowspan="3" class="segmentT ext">Participan t Details</td>
</tr>
</table>
...
<!-- The form details -->
</xsl:element>

So the correct output is:
<form method="post" target="_blank" action="http://win2003p2/online+feedback .htm">
...

But in .net the result given is:
<form>

Code that doing transformation:
StringWriter sw = new StringWriter();
XmlWriter writer = new XmlTextWriter(s w);
// template is the XslTransform, doc is the XmlDocument
template.Transf orm(doc, new XsltArgumentLis t(), writer, newXmlUrlResolv er());

Really appreciate if can help. Thanks!!
--------------------------------
From: Wayne Lian

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>AkMEKzoeS0C gPm0ice4BDw==</Id>
Nov 12 '05 #1
1 1790
Wayne Lian via .NET 247 wrote:
Hi all, Just wonder anyone have encountered this problem before? I
tried using XMLSPY debugger and I can get the correct output for my
XSLT transformation, however in .net, after transformation the
attributes I put inside xsl:element tag cannot be generated. Part of the XSLT data: <xsl:element name="form"> <xsl:attribut e
name="method">p ost</xsl:attribute> <xsl:attribut e
name="target">_ blank</xsl:attribute>


btw, why not just
<form method="post" target="_blank" > ?

Anyway, I cannot reproduce the problem. Provide small reproducible
sample please.

PS. By any chance you've got xml:space="pres erve" somewhere before
xsl:element?
--
Oleg Tkachenko [XML MVP, XmlInsider]
http://blog.tkachenko.com
Nov 12 '05 #2

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

Similar topics

1
15082
by: Matt | last post by:
For example, how to represent hyperlink in XSL? I want to add hyperlink in XSL. i.e. I need to generate <A HREF="http://mypage.html">home page</A> in HTML. I tried the following approaches but still not work, it don't display anything Approach #1: direct link, not work A) double quote, <A HREF="<xsl:value-of select="/bio/homepage" />">home page</A> OR B) single quote, <A HREF='<xsl:value-of select="/bio/homepage" />'>home page</A>
6
2768
by: Thomas | last post by:
In Mozilla: The problem we are trying to solve: We are using XSL/XML to generate tables with text in the rows. The spacing is wider then when those same exact tables are created in regular HTML. We figured out that this has to do with Mozilla rendering the HTML page in quirks mode, versus the XML/XSL page being rendered in strict mode. I can find no way to enable quirks mode in Mozilla for XML/XSL documents, since it does not appear...
1
2369
by: Filip Hendrickx | last post by:
Hi there. I want to generate elements, choosing the element name dynamically. So I tried to use attribute value templates: <xsl:element name="{$local-name($someNode)}"> <!-- Generate element content. --> </xsl:element> where $someNode is an XML tree.
9
8368
SPanicker
by: SPanicker | last post by:
Hi, I am newbie to XSL transformations. I am finding it hard to work out the XSL transformation for the following XML. Can someone suggest me how to approach this XML or in general how should I start up if given a XML? SOURCE XML: <?xml version="1.0" encoding="iso-8859-1"?> <Batch BatchCreated="" TransType="TA" xmlns="http://www.w3.org/2001/xmlns"> <TA>
0
8459
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
8374
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8791
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
8575
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
8653
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
7398
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
6206
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...
2
2018
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1783
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.