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!

Anyone can help to makes this XML work?

Status
Not open for further replies.

inza141

Programmer
Jan 25, 2006
5
NL
Hello, I need to generate this XML, make a class in C#
and be able to fill in the parameters. Can anybody help me?
ThanXx


<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE ServiceChangeRequest SYSTEM "InmarsatSubscriberRequest.dtd">
<ServiceChangeRequest Type="SuspendSubscriber" TransactionId="1234567890" InternalTransactionId="12345678901234567890">
<CurrentState>
<ServiceDescription ServiceTag="PackageService">
<ParameterSet>
<ParameterDesc ParameterTag="IMSI" ParameterValue="123424499111110"/>
<ParameterDesc ParameterTag="MSISDN" ParameterValue="448934333"/>
<ParameterDesc ParameterTag="NationalNumber" ParameterValue="3172990"/>
<ParameterDesc ParameterTag="DpId" ParameterValue="10"/>
<ParameterDesc ParameterTag="Date" ParameterValue="21112003_123000"/>
</ParameterSet>
</ServiceDescription>
<ServiceDescription ServiceTag="Telephony">
<ParameterSet>
<ParameterDesc ParameterTag="MSISDN" ParameterValue="448934333"/>
<ParameterDesc ParameterTag="NationalNumber" ParameterValue="3172990"/>
</ParameterSet>
</ServiceDescription>
<ServiceDescription ServiceTag="CLIP">
<ParameterSet>
<ParameterDesc ParameterTag="State" ParameterValue="1"/>
<ParameterDesc ParameterTag="SOCLIP" ParameterValue="0"/>
</ParameterSet>
</ServiceDescription>
</CurrentState>
<StateDelta>
<ServiceDescription ServiceTag="PackageService" Id="695">
<ParameterSet>
<ParameterDesc ParameterTag="IMSI" ParameterValue="123424499111110"/>
<ParameterDesc ParameterTag="MSISDN" ParameterValue="448934333"/>
<ParameterDesc ParameterTag="NationalNumber" ParameterValue="3172990"/>
<ParameterDesc ParameterTag="DpId" ParameterValue="10"/>
<ParameterDesc ParameterTag="Date" ParameterValue="21112003_123000"/>
</ParameterSet>
</ServiceDescription>
</StateDelta>
</ServiceChangeRequest>


 
C# has its own forum - i would suggest you look toward there for programming classes.

How do you need to generate the xml ? if from database, then look at the sql / database forums.

To start though, create the xml, load it into an xmldocument object in .net, strip to xmlelement, then use xpath to get the parameter of the node you want and use the setattribute method.

good luck.
 
This might help you:
Code:
XmlTextWriter w = new XmlTextWriter("MyXML.xml", System.Text.Encoding.UTF8);
w.WriteStartDocument(true);
w.WriteDocType("ServiceChangeRequest", null, "InmarsatSubscriberRequest.dtd", null);
w.WriteStartElement("ServiceChangeRequest");
w.WriteAttributeString("Type", "SuspendSubscriber");
w.WriteStartElement("CurrentState");
w.WriteEndElement();
w.WriteEndElement();
w.WriteEndDocument();

Jon

"I don't regret this, but I both rue and lament it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top