|
-
Apr 5th, 2003, 05:22 AM
#1
Thread Starter
Junior Member
Dom documents?
Could anyone give me a really short example of how to read nodes with domdocuments in vb.net?
and also how to write values to the node? plz??? =/
-
Apr 5th, 2003, 09:21 AM
#2
Thread Starter
Junior Member
Hmm?
well seems like I dont need that much help now after all, still im using webservices to alter the attribute of an xmlfile the code Im using looks like this...
<WebMethod()> Public Function setattribute(ByVal value As String) As String
Try
Dim xmlDoc As XmlDocument = New XmlDocument()
xmlDoc.Load(Server.MapPath(".") & "\file.xml")
Dim xNode As Xml.XmlNode = xmlDoc.DocumentElement.SelectSingleNode("/customer")
xNode.Attributes("name").Value = value
Return xNode.Attributes("name").Value
Catch
End Try
End Function
well it all works fine except for one thing, the xmlfile never get saved? Ive tried with xmlDoc.save(Server.MapPath(".") & "\file.xml")
but then I get some error, what am I doing wrong?
-
Apr 5th, 2003, 09:29 AM
#3
Thread Starter
Junior Member
Hmm?
well seems like I dont need that much help now after all, still im using webservices to alter the attribute of an xmlfile the code Im using looks like this...
<WebMethod()> Public Function setattribute(ByVal value As String) As String
Try
Dim xmlDoc As XmlDocument = New XmlDocument()
xmlDoc.Load(Server.MapPath(".") & "\file.xml")
Dim xNode As Xml.XmlNode = xmlDoc.DocumentElement.SelectSingleNode("/customer")
xNode.Attributes("name").Value = value
Return xNode.Attributes("name").Value
Catch
End Try
End Function
well it all works fine except for one thing, the xmlfile never get saved? Ive tried with xmlDoc.save(Server.MapPath(".") & "\file.xml")
but then I get some error, what am I doing wrong?
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|