473,385 Members | 1,888 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,385 software developers and data experts.

Modify the XLST DOM

I have a stylesheet embedded in my html page like:

<xml id="xslFix">
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html"/>
<xsl:param name="statusfield"></xsl:param>
......<snip>....
</xml>

I want to modify the:
<xsl:param name="statusfield"></xsl:param> node and add a text node
there so it looks like:
<xsl:param name="statusfield">stuff in here</xsl:param>

<script language="JavaScript">
var sf = new ActiveXObject("MSXML2.FreeThreadedDOMDocument.4.0" );
sf.load(xslFix);
var omap = sf.documentElement.getElementsByTagName('xsl:param ');
for ( var i=0; i<omap.length; i++ )
{
if ( omap.item(i).getAttribute("name") == "statusfield" )
{
myText=omap.item(i).createTextNode('stuff..');
omap.item(i).appendChild(myText);
}
}
</script>

But this does not work. I get an error message saying something about
this object not avaailable in this manner.
Any help is appreciated.

Mike

Jul 23 '05 #1
1 1372
mike wrote:
I have a stylesheet embedded in my html page like:

<xml id="xslFix">
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
version="1.0">
<xsl:output method="html"/>
<xsl:param name="statusfield"></xsl:param>
.....<snip>....
</xml>

I want to modify the:
<xsl:param name="statusfield"></xsl:param> node and add a text node
there so it looks like:
<xsl:param name="statusfield">stuff in here</xsl:param>

<script language="JavaScript">
var sf = new ActiveXObject("MSXML2.FreeThreadedDOMDocument.4.0" );
sf.load(xslFix);
var omap = sf.documentElement.getElementsByTagName('xsl:param ');
for ( var i=0; i<omap.length; i++ )
{
if ( omap.item(i).getAttribute("name") == "statusfield" )
{
myText=omap.item(i).createTextNode('stuff..');
omap.item(i).appendChild(myText);
}
}
</script>

But this does not work. I get an error message saying something about
this object not avaailable in this manner.
Any help is appreciated.

Mike


Believe createTextNode() is just a factory method, a member of
Document. Unlike, say, getElementsByTagName(), it's not a method of
other Node objects. Might try...

myText=document.createTextNode('stuff..');
omap.item(i).appendChild(myText);

Jul 23 '05 #2

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

Similar topics

4
by: Pascal Sartoretti | last post by:
Hello, I am looking for a formal definition of XSLT. Either a DTD or an XML Schema, whatever. Is there such a thing ? There is for instance one for XML Schema itself at...
1
by: Vital Lobachevsky | last post by:
Hi! I'm absolutely newbie with XSLT. Please, help me with this example. I have simple XML document like this: <skip /> <aaa> <link url="url1" /> <link url="url2" />
3
by: Hai Nguyen | last post by:
I would like to know after transforming my datatables which store in dataset into XML form. Now I want to save it into a file and also create a XLST file to read it. How can I do that? Would you...
3
by: Hai Nguyen | last post by:
Sorry I don't have code yet. I'm asking for solutions which can help me solve the problem. This is the first time I have to cope this situation, hence I'm clueless how to start. I would like to ask...
1
by: Adrian | last post by:
Hi No sure if xlst is the correct choice! or if it is how I would use it from within a windows VB application! I had XML data help in an xmlelements object and I want to format the data and...
1
by: ad | last post by:
Hi, How can I use xlst to display a xml file in asp.net?
5
by: MD | last post by:
my database return the search result in the xml. I have about 100 fields with 10 records if i use the dom to parse in the browser with javascript takes about 30 seconds to generate the table with...
1
by: dave_kajinsky | last post by:
Hello all, I would like to do something with xlst, perhaps I can get help from this group? Here it goes: I've got 2 files: an ascii file and a file that identifies tokens in the ascii file. ...
1
by: sarah12 | last post by:
HI, This time , I need to write the XSL to transform the following document : <?xml version="1.0"?> <nplbiblio rundate="20080110"> <document status="U" creadate="19990410">...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
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
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
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
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
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...

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.