Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with XML

Status
Not open for further replies.

Elsje

Programmer
Feb 20, 2004
44
BE
Hi,

I'm writing an xml-file.
Up until now I have done the following:
Example:
<Dbtr>
<Nm>Name</Nm>
</Dbtr>
writerXTimes.WriteStartElement("", "Dbtr", "")
writerXTimes.WriteElementString("Nm", "Name")
writerXTimes.WriteEndElement()
This gives me the wanted result.

But now I need the following:
<Amount Ccy = "EUR">25</Amount>
Is there an easy way to do this?

I have imported system.xml and I use a xmlTextWriter.

Thanks in advance
Elsje
 
>Is there an easy way to do this?
[tt]
writerXTimes.WriteStartElement("","Amount","")
writerXTimes.WriteAttributeString("Ccy","EUR");
writerXTimes.WriteString("25")
writerXTimes.WriteEndElement();
[/tt]
How easy is easy?
 
Incomplete editing my c# drafting! Here is the relist.
[tt]
writerXTimes.WriteStartElement("","Amount","")
writerXTimes.WriteAttributeString("Ccy","EUR")
writerXTimes.WriteString("25")
writerXTimes.WriteEndElement()
[/tt]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top