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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

xml document with xmlns and xsi

Status
Not open for further replies.

Elsje

Programmer
Feb 20, 2004
44
BE
Hello,

I'm trying to write a xml document but I have a small problem with it.
When I take a look at the result it almost looks fine except for one small detail.

This is my result:

<?xml version="1.0" encoding="utf-8"?>
<Document xmlns:xsi=" xmlns="urn:uso:std:iso:20022:tech:xsd:pain.008.001.02">
<CstmrDrctDbtInitn xmlns="">
<GrpHdr>
<MsgId>bbbb_Z0522</MsgId>
<CreDtTm>2013-05-07T07:40:16</CreDtTm>
<NbOfTxs>1</NbOfTxs>

Why is there an xmlns next to the tag 'CstmrDrctDbtInitn'.

This is my code:
writerFirstTime.WriteStartDocument()
writerFirstTime.WriteStartElement("Document", "urn:uso:std:iso:20022:tech:xsd:pain.008.001.02")
writerFirstTime.WriteAttributeString("xmlns", "xsi", Nothing, "writerFirstTime.WriteStartElement("", "CstmrDrctDbtInitn", "")
writerFirstTime.WriteStartElement("", "GrpHdr", "")

I hope someone can tell me what I did wrong.

Thanks in advance
Elsje
 

Did you override the WriteStartElement method in a class of your own? I ask because the MSDN definition of the WriteStartElement method shows it only takes one parameter, yet you are passing 3 parameters.

I used to rock and roll every night and party every day. Then it was every other day. Now I'm lucky if I can find 30 minutes a week in which to get funky. - Homer Simpson

Arrrr, mateys! Ye needs ta be preparin' yerselves fer Talk Like a Pirate Day!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top