468,170 Members | 2,058 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,170 developers. It's quick & easy.

XMLSerialization Suppress Element Name to Mimic HTML Anchor Tag

I am trying to mimic the html anchor tag. I have created a class;

Public Class anchor
<XmlAttributeAttribute()> _
Public href As String
Public title As String
End Class

and get the following XML;

<a href="http://www.GM.com">
<title>GM</title>
</a>

when I would like to get;

<a href="http://www.GM.com">GM</a>

Is there a way to modify the class definition to suppress the <title> and
</title> tags? Thank you in advance for any advice.
--

Best Regards
Todd
Nov 12 '05 #1
1 1388
"Todd" <To**@discussions.microsoft.com> wrote in message news:DF**********************************@microsof t.com...
Public Class anchor
<XmlAttributeAttribute()> _
Public href As String
Public title As String
End Class : : I would like to get;

<a href="http://www.GM.com">GM</a>


Todd, try the XmlTextAttribute. You're allowed to use it on up to one field
within a class.

- - - anchor.vb (excerpt)
Public Class anchor
<XmlAttributeAttribute( )> _
Public href As String
<XmlTextAttribute( )> _
Public title As String
End Class
- - -

Derek Harmon
Nov 12 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

2 posts views Thread by Fezboy | last post: by
22 posts views Thread by Haines Brown | last post: by
1 post views Thread by Arthur Pratz | last post: by
reply views Thread by Jon Cosby | last post: by
1 post views Thread by gcdp | last post: by
reply views Thread by gcreed | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.