473,396 Members | 1,816 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.

XSL output option and <xsl:import>

Dormilich
8,658 Expert Mod 8TB
Hi,

my goal is to have a stylesheet, where I can change the encoding attribute of the <xsl:output> element (one shall have utf-8 and the other latin-1). is there any way to set this via a parameter (or something) or do I have to call a separate file for every different output? I know I can change the original xsl file with a stylesheet, but that's more effort than making two files. I thought that I can maybe overwrite the original <xsl:output> element when using <xsl:import>, but I didn't find any notes on that in the net.

thanks
Jan 20 '09 #1
2 2592
jkmyoung
2,057 Expert 2GB
Depends on how you're running the transformation. If you're loading up the xsl in a document object before running it, the document can be changed before running. Similar to how people used to set parameters in javascript with xsl:
Expand|Select|Wrap|Line Numbers
  1. oNode = doc.SelectSingleNode("//xsl:output");
  2. oNode.setAttribute('encoding',value);
  3.  
Not aware of any easier way to do it.
Jan 20 '09 #2
Dormilich
8,658 Expert Mod 8TB
I'm doing quite straight-of-the-book xsl transformation with PHP (ok, I made a class for the ease of handling). right now it is probably easier to use different files rather than making DOM change the attribute..... (it's an effort-gain thing)
Jan 20 '09 #3

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

Similar topics

2
by: Robert Kattke | last post by:
I'm working with Tomcat and have all my XSL files in a dir under WEB-INF. I wanted to set up some variables in an XSL, then import it into others. However, without any path specified it (zalan)...
2
by: bjam | last post by:
Hi, I am trying to do the following, which is to have a single place to define my table paramaters such as cellpadding / cellspacing etc. Below is the code I am trying to achieve see the cell...
12
by: Sammy | last post by:
Hi, my mind is going crazy. I have tried everything I can think of to no avail. I have tried Disable Output Escaping. I tried to think of a way of enclosing the attribute data in a CDATA...
0
by: Joseph A Romeo | last post by:
I have written an XSLT transformation on an ASP.NET page. The resulting HTML is primarily a table of links. I have found that when the resulting HTML is less than or equal to 16040 bytes, the...
5
by: Luke Vogel | last post by:
Hi all, Probably a really basic question, but I cant find an answer ... I have an xml file of books something like: <product> <isbn>0-735-61374-5</isbn> <title>Microsoft Visual Basic Step By...
8
by: Subra Mallampalli | last post by:
Hi, I am trying to use <runtime> section within the web.config file. However, the contents of the <runtime> section seem to be ignored. What am i missing here? Is <runtime> section not used by...
7
by: stefano | last post by:
Hi all, I hopen a new empty window from js code: var win = window.open("","debug","width=500,height=300,modal,dialog,resizable"); and I add some element to the new window:...
1
by: seeCoolGuy | last post by:
I've been using Access to import some data straight into a sql server database by simply importing the xml file. However lately some of the newer xml files will contain vaild data such as ...
8
by: Hoi Wong | last post by:
With the XSLT 1.0 engine that I was forced to use, I have to parse old XML scripts where the number (to be parsed and saved into $EPISODE_NUMBER_RAW) that I want to parse is written with a comma...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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.