473,396 Members | 1,773 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Setting innertext value with XMLSerializer

Hi.

The question is: How do I set the value of PageElement to the innertext
'Hello World' in my xml when I use XMLSerializer?

My source xml is:

<book>
<page number="1">Hello World</page>
</book>

My source classes are:

<xmlroot("book")> Public class Book()
<xmlIgnore()> Private m_page as PageElement

<xmlElement("page")> Public Property Page() as PageElement
Get
return m_page
End Get
Set(byval value as PageElement)
m_page = value
End Set
End Property
End class

Public Class PageElement

<xmlIgnore()> Private m_pageNumber as string

Public Property PageNumber() as String
Get
Return m_pageNumber
End Get
Set(byval value as String)
m_pageNumber = value
End Set

End Property

Thanks -
- P

Nov 12 '05 #1
2 1540
That property on Book should be <xmlAttribute("page")>, not
<xmlElement("page")> ....

;)

"Paul Duncan" <jp*********@gmail.com> wrote in message
news:ex**************@TK2MSFTNGP10.phx.gbl...
Hi.

The question is: How do I set the value of PageElement to the innertext
'Hello World' in my xml when I use XMLSerializer?

My source xml is:

<book>
<page number="1">Hello World</page>
</book>

My source classes are:

<xmlroot("book")> Public class Book()
<xmlIgnore()> Private m_page as PageElement

<xmlElement("page")> Public Property Page() as PageElement
Get
return m_page
End Get
Set(byval value as PageElement)
m_page = value
End Set
End Property
End class

Public Class PageElement

<xmlIgnore()> Private m_pageNumber as string

Public Property PageNumber() as String
Get
Return m_pageNumber
End Get
Set(byval value as String)
m_pageNumber = value
End Set

End Property

Thanks -
- P

Nov 12 '05 #2
Ah. The ever important <xmlText()> attribute.

Now, if only I could get it to accept <b>hello world!</b> ...

hm. Ideas?

"Paul Duncan" <jp*********@gmail.com> wrote in message
news:uH*************@TK2MSFTNGP09.phx.gbl...
That property on Book should be <xmlAttribute("page")>, not
<xmlElement("page")> ....

;)

"Paul Duncan" <jp*********@gmail.com> wrote in message
news:ex**************@TK2MSFTNGP10.phx.gbl...
Hi.

The question is: How do I set the value of PageElement to the innertext
'Hello World' in my xml when I use XMLSerializer?

My source xml is:

<book>
<page number="1">Hello World</page>
</book>

My source classes are:

<xmlroot("book")> Public class Book()
<xmlIgnore()> Private m_page as PageElement

<xmlElement("page")> Public Property Page() as PageElement
Get
return m_page
End Get
Set(byval value as PageElement)
m_page = value
End Set
End Property
End class

Public Class PageElement

<xmlIgnore()> Private m_pageNumber as string

Public Property PageNumber() as String
Get
Return m_pageNumber
End Get
Set(byval value as String)
m_pageNumber = value
End Set

End Property

Thanks -
- P


Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: netclectic | last post by:
I'm dynamically adding options to a select list in javascript and i need to be able to set the height of the option, but setting style.height has not effect, I also tried style.pixelHeight but no...
4
by: Hollywood | last post by:
I'm using XML serialization to produce the following XML document: <TestDoc xmlns:srd="some-url"> <Additional> <Security> <srd:Login>login_id</srd:Login> <srd:Password>password</srd:Password>...
3
by: Dan | last post by:
I've loaded the following xml into an XMLDocument object: <?xml version="1.0" ?> - <Preferences> <Institution>Argh</Institution> <Speaker>Chigier, Ben (1234)</Speaker>...
4
by: John Vottero | last post by:
When a class contains a TimeSpan property, XmlSerializer doesn't work. A TimeSpan property is serialized like: <MySpan /> I've read a number of posts that talk about why this happens and how...
1
by: Robert Storrs | last post by:
I need to set the value of a asp text box in javascript. <asp:TextBox id="txtUserValue" runat="server" >test</asp:TextBox> I have tied: function setValue(valueData) { alert(valueData);
1
by: Mike | last post by:
Hi, I am developing a JavaScript calendar control. I want my user control to expose a property that returns the value of the selected calendar date. I have an "input" control that displays the...
13
by: Lyners | last post by:
I have a web page writen in ASP.NET that contains some javascript so that when a user presses a button, or edits a certain field in a datagrid, another cell in the datagrid is filled with a value....
4
by: kishore | last post by:
Hi I have a file similar to below <filter> <param id="xx">This is test</param> <param id="yy">This is another test </param> </filter> I created classes as below
5
by: GarryJones | last post by:
To show users how many characters they have left in a TEXTAREA input I have been using "taCount" from a website I googled. function taCount(visCnt) { var taObj=event.srcElement; if...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.