473,795 Members | 2,805 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

"This document already has a 'DocumentElemen t' node" error

1 New Member
I am clueless...
Here is my code:
Private Sub genCodeDynamic( ByVal nIn As XmlNode, ByRef nOut As XmlNode, ByVal docOut As XmlDocument, _
ByVal stopAtNode As XmlNode, ByVal dr As DataRow)
Dim d1 As String = docOut.InnerXml 'debug

Try
Dim t As XmlNode 'text nodes
If Not (nIn Is Nothing) AndAlso nIn.HasChildNod es Then
Dim xc As XmlNodeList = nIn.SelectNodes ("*")
Dim x As XmlNode
For Each x In xc
nOut = nOut.AppendChil d(docOut.Create Element(x.Name) )

t = x.SelectSingleN ode("text()")

If Not (t Is Nothing) Then
If Len(t.Value) > 3 And Microsoft.Visua lBasic.Left(t.V alue, 3) = "DB:" Then
'Dim dtest As String = dr("docid")
Dim drs As String = Database.safedb str(dr, Microsoft.Visua lBasic.Right(t. Value, Len(t.Value) - 3))
nOut.AppendChil d(docOut.Create TextNode(Databa se.safedbstr(dr , Microsoft.Visua lBasic.Right(t. Value, Len(t.Value) - 3))))
Else
nOut.AppendChil d(docOut.Create TextNode(t.Valu e))
End If

End If

Dim ac As XmlAttributeCol lection = x.Attributes
Dim aIn As XmlAttribute
Dim aOut As XmlAttribute
For Each aIn In ac
aOut = docOut.CreateAt tribute(aIn.Nam e)
If Len(aIn.Value) > 3 And Microsoft.Visua lBasic.Left(aIn .Value, 3) = "DB:" Then
aOut.Value = Database.safedb str(dr, Microsoft.Visua lBasic.Right(aI n.Value, Len(aIn.Value) - 3))
Else
aOut.Value = aIn.Value
End If
'ret = ret & "a.Value = """ & a.Value & """" & vbCrLf
nOut.Attributes .SetNamedItem(a Out)
Next
'Now get all the child nodes of x
If x.HasChildNodes AndAlso Not (x Is stopAtNode) Then
'ret = genCode(x, ret, stopAtNode)
genCodeDynamic( x, nOut, docOut, stopAtNode, dr)
End If
nOut = nOut.ParentNode
Next
End If

Catch ex As Exception
handleException (ex)
End Try
End Sub
Jul 18 '07 #1
0 1337

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

Similar topics

14
2263
by: Ernst Murnleitner | last post by:
Dear Readers, Is it possible to forbid conversion from this or use of this in general except where it is explicitly wanted? Reason: I changed my program from using normal pointers to classes A, ... typedef A * APtr;
0
4354
by: Colleyville Alan | last post by:
My app is giving me this error. Run-time error 3211: The database engine could not lock table 'Sorted_Template' because it is already in use by another person or process. When I run the app the first time through, it runs fine. I get this when I run a make-table query that tries to write out the table called "Sorted_Template". I tried using a TableDefs.Delete command thinking that make using the docmd.openquery was causing the...
0
2286
by: Richard Sherratt | last post by:
Something to add to your trivia bank. I've seen previous questions on this error but they've all been for adding new records to the RecordsetClone. I got it trying to edit an existing record. I have a "Roles" subform on a Job form where employees are assigned to jobs with the roles being "lead architect", "landscape architect", etc. The table being updated has EmployeeID, RoleID, StartDate, EndDate, etc.
4
34584
by: Saso Zagoranski | last post by:
Hi! I have a little search textbox, which goes through a dataset as the user types in the textbox... If the user types "1", then all the fields beginning with a 1 get shown in the datagrid... here's the problem... I load the dataSet with all possible entries at Form_Load event... but during the search I don't want to change the initial dataSet, so I have
4
1334
by: Richard | last post by:
When I reference "this" in call to event, I get the following error: An unhandled exception of type 'System.NullReferenceException' occurred in csbasesockets.dll Additional information: Object reference not set to an instance of an object. Here is a summary of my code:
0
1555
by: Neal | last post by:
I am getting the "This type of page is not served." error the first time I access our asp.net site after an application restart. I can hit refresh and it will work fine the second and every other time. This behavior just recently started and we can't figure out why it started. This is an application that has been working correctly without ever getting this error. Can someone point me in the right direction?
0
1442
by: gahagan | last post by:
If you encounter this error, most likely one of the controls you're trying to cut/paste is a combo box with a longer-than-average 'Row Source' value. That, apparently, is the problem. Shorter Row Source values don't seem to be a problem. (I don't have time to figure out at what length the error triggers.) Workaround: Remove the Row Source (you can cut/paste the text somewhere else), then try cutting/pasting the control(s) again. Then...
1
9192
by: gslim | last post by:
I am trying to implement the busybox sample from // From Mark Wagner // http://blogs.crsw.com/mark/articles/642.aspx When I get to this line I get an access denied error. Could someone give me an idea why this might be? Here is the entire function
5
5581
by: darrel | last post by:
We're getting this error on a page that uses a particular User Control we created: "An Error has Occured retrieving the news item. Attempted to read or write protected memory. This is often an indication that other memory is corrupt." Googling this seems to turn up a random assortment of potential causes. What is odd is that in our situation, I can compile it on my machine and it
6
2328
by: babakandme | last post by:
Hi to every body...:D I'm a novice C++ programmer & I've a question, I have the ClassA & in it's constructor, I instantiate ClassB, and I want send "this" pointer """pointer to ClassA""" to the ClassB. But I get this Error from the compiler: and it's in ClassB... Error from the compiler: error C2061: syntax error : identifier 'TestA' error C2143: syntax error : missing ';' before '*'
0
9673
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
10216
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
10165
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
10002
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
7543
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
5437
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...
0
5565
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4113
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
3
2921
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.