Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Services > Namespace Declaration

Reply
Thread Tools

Namespace Declaration

 
 
Dave T
Guest
Posts: n/a
 
      08-20-2007
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).RemoveAl l()
'End If

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

Return _xml
End Function


 
Reply With Quote
 
 
 
 
Adrian Moore
Guest
Posts: n/a
 
      08-21-2007
Hi

Have you considered this...

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

Hope this helps
Ad.

"Dave T" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
>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).RemoveAl l()
> 'End If
>
> 'If _xml.DocumentElement.NamespaceURI.Length > 0 Then
> ' _xml.DocumentElement.SetAttribute("xmlns", Nothing)
> 'End If
>
> Return _xml
> End Function
>
>



 
Reply With Quote
 
 
 
 
Dave T
Guest
Posts: n/a
 
      08-21-2007
That does it. I sure am curious though why I couldn't get it done with my
other calls. Thanks

"Adrian Moore" wrote:

> Hi
>
> Have you considered this...
>
> Dim XmlWithoutNS as String =
> _DALSearchData.GetXml.Replace("xmlns=""""",String. Empty)
>
> Hope this helps
> Ad.
>
> "Dave T" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
> >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).RemoveAl l()
> > 'End If
> >
> > 'If _xml.DocumentElement.NamespaceURI.Length > 0 Then
> > ' _xml.DocumentElement.SetAttribute("xmlns", Nothing)
> > 'End If
> >
> > Return _xml
> > End Function
> >
> >

>
>
>

 
Reply With Quote
 
Adrian Moore
Guest
Posts: n/a
 
      08-23-2007
Dave,

Sometimes the simplest approach works best.

Ad.

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



 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can a static function declaration conflict with a non-static declaration? nospam_timur@tabi.org C Programming 4 12-12-2006 10:26 PM
maxplusII error: a deferred constant declaration without a full declaration is not supported Noah VHDL 5 04-07-2006 02:34 PM
"virtual outside class declaration" and "declaration does not declare anything" kelvSYC C++ 6 05-17-2005 08:58 AM
Function declaration in class declaration Ovidesvideo C++ 4 12-10-2004 06:36 PM
Intel C++ 8.0 : declaration hides declaration Alex Vinokur C++ 4 04-05-2004 09:49 PM



Advertisments