473,796 Members | 2,538 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Modify the XLST DOM

I have a stylesheet embedded in my html page like:

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

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

<script language="JavaS cript">
var sf = new ActiveXObject(" MSXML2.FreeThre adedDOMDocument .4.0");
sf.load(xslFix) ;
var omap = sf.documentElem ent.getElements ByTagName('xsl: param');
for ( var i=0; i<omap.length; i++ )
{
if ( omap.item(i).ge tAttribute("nam e") == "statusfiel d" )
{
myText=omap.ite m(i).createText Node('stuff..') ;
omap.item(i).ap pendChild(myTex t);
}
}
</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 1395
mike wrote:
I have a stylesheet embedded in my html page like:

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

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

<script language="JavaS cript">
var sf = new ActiveXObject(" MSXML2.FreeThre adedDOMDocument .4.0");
sf.load(xslFix) ;
var omap = sf.documentElem ent.getElements ByTagName('xsl: param');
for ( var i=0; i<omap.length; i++ )
{
if ( omap.item(i).ge tAttribute("nam e") == "statusfiel d" )
{
myText=omap.ite m(i).createText Node('stuff..') ;
omap.item(i).ap pendChild(myTex t);
}
}
</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, getElementsByTa gName(), it's not a method of
other Node objects. Might try...

myText=document .createTextNode ('stuff..');
omap.item(i).ap pendChild(myTex t);

Jul 23 '05 #2

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

Similar topics

4
2134
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 http://www.w3.org/2001/XMLSchema.dtd . My problem is that I have a big set of XSLT files which may contain errors: for instance, use of XLST features that were only in the draft XSLT norm, but which Microsoft IE still supports. A DTD or XML Schema would greatly help me...
1
3067
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
2630
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 give me any advice or link to further my understandings. Thanks for any clues
3
1474
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 for some ideas then I can start from scratch. Let's say: I have a dataset which has a table Customers (which retrieves from an Access Database) 1/ I convert it into XML format, it should look like this <Customer> <Name>...</Name>
1
1207
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 display it within my VB dotnet windows application. the data is not held in a file it is received back from a web service, and I want to avoid writing it as a file and reading it back! What's the best way of doing this? any links to examples?
1
1191
by: ad | last post by:
Hi, How can I use xlst to display a xml file in asp.net?
5
1493
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 search result If i use the xlst to transform this xml document to table any faster? if not faster way to display this complicated data with 100 fields?
1
1971
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. For example the ascii file could be:
1
1709
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"> <xp>000000028876</xp> <doctype>ABSTRACT</doctype> <prdate>19880131</prdate>
0
9684
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
10459
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10236
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
10182
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
10017
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...
1
7552
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
6793
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
4120
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3734
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.