Namespace Declaration

D

Dave T

I have a typed dataset that I'm returning from a webservice which has the
xmlns="SomeURI" attribute defined

My CLASSIC ASP front end developer can't get her xsl to work with that
namespace declaration so I'm trying to get rid of it. The closest I can get
is xmlns="" and I can do that a hundered different ways.

Does anyone know how to get rid of it all together?

=======================

if it helps, here are the various things I've tried

Private Function GetXMLFromDataset() As System.Xml.XmlDocument
Dim _xml As New System.Xml.XmlDocument
_xml.LoadXml(_DALSearchData.GetXml)

'_xml.DocumentElement.Attributes.RemoveNamedItem("xmlns")

'_xml.DocumentElement.RemoveAttribute("xmlns")

'_xml.Attributes.RemoveNamedItem("xmlns")

'Dim _XMLAttributes As System.Xml.XmlAttributeCollection
'_XMLAttributes = _xml.XmlAttributeCollection
'_XMLAttributes.RemoveNamedItem("xmlns")

'Dim _DocElement As System.Xml.XmlElement = _xml.DocumentElement
'Dim _Attributes As System.Xml.XmlAttributeCollection =
_DocElement.Attributes
'_Attributes(0).RemoveAll()

'If _xml.DocumentElement.NamespaceURI.Length > 0 Then
' _xml.DocumentElement.Attributes.ItemOf(0).RemoveAll()
'End If

'If _xml.DocumentElement.NamespaceURI.Length > 0 Then
' _xml.DocumentElement.SetAttribute("xmlns", Nothing)
'End If

Return _xml
End Function
 
A

Adrian Moore

Hi

Have you considered this...

Dim XmlWithoutNS as String =
_DALSearchData.GetXml.Replace("xmlns=""""",String.Empty)

Hope this helps
Ad.
 
D

Dave T

That does it. I sure am curious though why I couldn't get it done with my
other calls. Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top