Hi all i just got this form VB at the movies example
VB Code:
Dim xmlDoc As New XmlDocument Dim xmlDeclare As XmlDeclaration = xmlDoc.CreateXmlDeclaration("1.0", "UTF-8", "yes") Dim xmlComment As XmlComment = xmlDoc.CreateComment("Created by " & Site_URL) Dim xmlRoot As XmlElement = xmlDoc.CreateElement("Errors") Dim xmlPosted As XmlAttribute = xmlDoc.CreateAttribute("Posted") Dim xmlPage As XmlElement = xmlDoc.CreateElement("PageWithError") Dim xmlErrMsg As XmlElement = xmlDoc.CreateElement("ErrorOccurred") xmlDoc.InsertBefore(xmlDeclare, xmlDoc.DocumentElement) xmlDoc.InsertAfter(xmlComment, xmlDeclare) xmlDoc.InsertAfter(xmlRoot, xmlComment) xmlPosted.InnerText = Now() xmlPage.InnerText = "page.aspx" xmlErrMsg.InnerText = "just testing" xmlRoot.SetAttributeNode(xmlPosted) xmlRoot.AppendChild(xmlPage) xmlRoot.AppendChild(xmlErrMsg) xmlDoc.Save("WebSiteErrors.xml")
it creates the xml document and node fine but i would like to have another method in my class AddChildNode()
this will just append another node to the xml document
what i am doing is having a class file for trapping errors
i passed the page it errored and the string of error message
then view the xml document in a little app im making
thanks all
this is currently what im getting
this is what i wantCode:<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <!--Created by http://www.katiya.com--> <Errors Posted="12/06/2004 10:58:37"> <PageWithError>page.aspx</PageWithError> <ErrorOccurred>just testing</ErrorOccurred> </Errors>
Code:<?xml version="1.0" encoding="UTF-8" standalone="yes"?> <!--Created by http://www.katiya.com--> <Errors Posted="12/06/2004 10:58:37"> <PageWithError>page.aspx</PageWithError> <ErrorOccurred>just testing</ErrorOccurred> </Errors> <Errors Posted="12/06/2004 10:58:37"> <PageWithError>page.aspx</PageWithError> <ErrorOccurred>just testing</ErrorOccurred> </Errors> <Errors Posted="12/06/2004 10:58:37"> <PageWithError>page.aspx</PageWithError> <ErrorOccurred>just testing</ErrorOccurred> </Errors> <Errors Posted="12/06/2004 10:58:37"> <PageWithError>page.aspx</PageWithError> <ErrorOccurred>just testing</ErrorOccurred> </Errors>


Reply With Quote