473,806 Members | 2,944 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Troubles with editing XSLT doc

Hy I'm trying to edit a XSLT document, just like I'm editing a XML document
:
(Im trying to make a new xsl:template tag here )
Dim myXml As New XmlDocument()
myXml.Load(Serv er.MapPath("XSL Links.xslt"))

Dim XmlLinks As XmlElement
Dim XmlNewLink As XmlElement
XmlLinks = myXml.SelectSin gleNode("//xsl:stylesheet" )
XmlNewLink = myXml.CreateEle ment("xsl:templ ate")
XmlLinks.Append Child(XmlNewLin k)
myXml.Save(Serv er.MapPath("XSL Links.xslt"))
But instead I get this error:

Namespace Manager or XsltContext needed. This query has a prefix, variable,
or user-defined function.

Do I have to edit a xslt document in a different way?
Thanks for your answer!

Nov 11 '05 #1
4 1482
jernej goricki wrote:

XmlLinks = myXml.SelectSin gleNode("//xsl:stylesheet" )


It won't work. You have to provide XmlNamespaceMan ager to resolve xsl
namespace prefix in //xsl:stylesheet expression.
See samples in SelectSingleNod e method documentation at MSDN:
http://msdn.microsoft.com/library/de...enodetopic.asp

--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 11 '05 #2
Hm...
I have some troubles with understanding this example

Dim doc As XmlDocument = New XmlDocument()
doc.Load(Server .MapPath("XSLLi nks.xslt"))

'Create an XmlNamespaceMan ager for resolving namespaces.
Dim nsmgr As XmlNamespaceMan ager = New XmlNamespaceMan ager(doc.NameTa ble)
nsmgr.AddNamesp ace("xsl", "xsl:http://www.w3.org/1999/XSL/Transform")

........This probably isnt the right way to create a namespace for use in
xslt?

'Select the book node with the matching attribute value.
Dim book As XmlNode
Dim root As XmlElement = doc.DocumentEle ment
book = root.SelectSing leNode("stylesh eet", nsmgr)


"Oleg Tkachenko" <oleg@NO_SPAM_P LEASEtkachenko. com> wrote in message
news:Oa******** ******@TK2MSFTN GP12.phx.gbl...
jernej goricki wrote:

XmlLinks = myXml.SelectSin gleNode("//xsl:stylesheet" )
It won't work. You have to provide XmlNamespaceMan ager to resolve xsl
namespace prefix in //xsl:stylesheet expression.
See samples in SelectSingleNod e method documentation at MSDN:

http://msdn.microsoft.com/library/de...enodetopic.asp
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 11 '05 #3
jernej goricki wrote:
I have some troubles with understanding this example
Read more about namespaces then, this is quite important topic when
working with XML.
'Create an XmlNamespaceMan ager for resolving namespaces.
Dim nsmgr As XmlNamespaceMan ager = New XmlNamespaceMan ager(doc.NameTa ble)
nsmgr.AddNamesp ace("xsl", "xsl:http://www.w3.org/1999/XSL/Transform")

No, it should be
nsmgr.AddNamesp ace("xsl", "http://www.w3.org/1999/XSL/Transform")

This associates xsl prefix with http://www.w3.org/1999/XSL/Transform
namespace name.
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 11 '05 #4
ok thanks, just that I'm on the right way :)
"Oleg Tkachenko" <oleg@NO_SPAM_P LEASEtkachenko. com> wrote in message
news:%2******** ********@TK2MSF TNGP10.phx.gbl. ..
jernej goricki wrote:
I have some troubles with understanding this example


Read more about namespaces then, this is quite important topic when
working with XML.
'Create an XmlNamespaceMan ager for resolving namespaces.
Dim nsmgr As XmlNamespaceMan ager = New XmlNamespaceMan ager(doc.NameTa ble) nsmgr.AddNamesp ace("xsl", "xsl:http://www.w3.org/1999/XSL/Transform")

No, it should be
nsmgr.AddNamesp ace("xsl", "http://www.w3.org/1999/XSL/Transform")

This associates xsl prefix with http://www.w3.org/1999/XSL/Transform
namespace name.
--
Oleg Tkachenko
http://www.tkachenko.com/blog
Multiconn Technologies, Israel

Nov 11 '05 #5

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

Similar topics

2
1538
by: Katie Beach | last post by:
I have a listbox in which I would like to be able to display a value of a hash, but when the user selects an element in the list, I need to be able to use the KEY associated with the value chosen for editing... I don't see an easy way to do this except to create a lookup array that contains an index and a KEY - the index will then be associated with the VALUE in listbox... this seems like a pretty messy way to do this, so I'd like to avoid it if...
4
4327
by: Daniel Cloutier | last post by:
Hi, is it possible to edit or write Word-files out of a Python-Program? thx in advance daniel
2
1371
by: jaco | last post by:
Hi, I'm new to Python and XML but still I want to create something that includes creating and editing XML using Python. Now I'm looking for a little example program that does (some of) this to set me on my way. Is there something like this available or can somebody give me some example lines that creates and saves some XML data?
2
3910
by: ted | last post by:
Was wondering if XSLT alone is appropriate for the following situation. From XML, I'm creating a small website (around 50 pages) with pages that link to each other through a nav menu and a "crumb-trail" of links. I'm transforming the XML with XSLT through Saxon. The nav menu and "crumb-trail" show the user where they are within the site and is made by reflecting the XML tree structure. My problem now is that when I want to generate...
19
1397
by: bugbear | last post by:
I've been using this technique for around a year to create "decorated" tabs and round cornered boxes (windows?) http://www.alistapart.com/articles/slidingdoors/ Everything worked fine (all the way from MacOs09, IE5 to Firefox). Because our product sometimes puts large
22
1934
by: Ted | last post by:
This page http://homepage.ntlworld.com/r.a.mccartney/test/utf-8_test_file_hacked_for_ie_with_local_dtd.xml doesn't work properly in Firefox or IE6. The faults are different. In Firefox the TestText entity is not recognised. In IE6, the <br /> tag doesn't cause a line break. Can anyone tell me what I'm doing wrong?
2
2571
by: Tim N. van der Leeuw | last post by:
I tried to create a windows executable of a pygtk program. My first attempt worked, kinda, except that no themes were applied and no readable fonts were found by pango; so all letters where just empty squares. But the program worked. I looked up some docs, found the following recipe on the PyGTK Wiki site: http://starship.python.net/crew/theller/moin.cgi/Py2exeAndPyGTK I followed those instructions to convert my setup.py file;...
18
1291
by: Istvan Albert | last post by:
Hello all, I've been debugging the reason for a major slowdown in a piece of code ... and it turns out that it was the zip function. In the past the lists that were zipped were reasonably short, but once the size exceeded 10 million the zip function slowed to a crawl. Note that there was memory available to store over 100 million items. Now I know that zip () wastes lots of memory because it copies the content of the lists, I had used...
0
1510
by: SAL | last post by:
Hello, I have a small Web app that has a couple of pages in it. Both pages have gridviews on them with basically the same ObjectDataSource. This object data source is a business class. One of the GridViews allows editing so I enable ViewState on that one. The other one does not so I disable ViewState on that one. The problem is that the one with the ViewState disabled is reporting correct row numbers while the other one does not. I can...
0
9719
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
9597
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
10620
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
10369
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
10372
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
10110
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
6877
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();...
0
5546
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4329
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

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.