| | |
create XML element with namespace
Please support our VB.NET advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Jun 2006
Posts: 2
Reputation:
Solved Threads: 0
Hi All,
I have a function. It creates an XML element with namespace "pre":
Then, I call that function in this way:
newElement(xmlDoc, "FirstName", "Peter", "pre")
I expect the result:
<pre:FirstName>Peter</FirstName>
However, the result has no "pre:", just:
<FirstName>Peter</FirstName>
Why?????
Mike
I have a function. It creates an XML element with namespace "pre":
Function newElement(ByVal doc As XmlDocument, _ ByVal Name As String, _ Optional ByVal text As String = Nothing, _ Optional ByVal pre As String = Nothing) As XmlElement Dim xmlEl As XmlElement = doc.CreateElement(pre, Name, "") If Not (text IsNothing) Then xmlEl.InnerText = text doc.DocumentElement.AppendChild(xmlEl) Return xmlEl EndFunction
Then, I call that function in this way:
newElement(xmlDoc, "FirstName", "Peter", "pre")
I expect the result:
<pre:FirstName>Peter</FirstName>
However, the result has no "pre:", just:
<FirstName>Peter</FirstName>
Why?????
Mike
![]() |
Similar Threads
- Parse a XML element with AJAX (JavaScript / DHTML / AJAX)
- XML data to database (RSS, Web Services and SOAP)
- JDOM Element problem (XML, XSLT and XPATH)
- XML Serialization (C#)
- "cannot resolve symbol"problem (Java)
Other Threads in the VB.NET Forum
- Previous Thread: Iis
- Next Thread: ASP .NET Web Application setup?
| Thread Tools | Search this Thread |
.net .net2008 2008 access account advanced application array basic beginner browser button buttons center click code combo cuesent data database datagrid datagridview date datetimepicker designer dissertation dissertations dissertationtopic excel exists fade filter forms generatetags gridview html images input insert intel internet listview map mobile module monitor msaccess net number objects open panel passingparameters pdf picturebox picturebox2 port position print printing problem regex right-to-left save search searchvb.net select serial settings shutdown socket sqldatbase sqlserver survey table temperature textbox timer timespan transparency txttoxmlconverter update user usercontol vb vb.net vb.netformclosing()eventpictureboxmessagebox vba vbnet visual visualbasic visualbasic.net visualstudio.net visualstudio2008 web winforms wpf wrapingcode xml year





