16,023,224 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Visual Basic questions
View Javascript questions
View .NET questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Member 15254125 (Top 8 by date)
Member 15254125
29-Jun-21 8:41am
View
Deleted
@Richard Deeming: It is very obvious that the question length is too big to put it in reply comment so it is put in this block.
Member 15254125
26-Jun-21 1:00am
View
Deleted
Hey Nguyen,
I have added my problem statement in the solution box because of the size limit in comment box
Member 15254125
26-Jun-21 0:13am
View
Deleted
Hey Nguyen,
Yes. Let me send you the datatable which need to be converted to JSON string as per the hierarchy shown in XML as below:
[envelope]
[auth]
[user] [CRD_IPEMA]
[password] [CRD_IPEMA]
[session] [session1]
[/auth]
[swapSecurityService]
[envelope/swapSecurityService/parentSec]
[parentSec] [USD 0f10Y Pay Fixed - 27/02/2017SWAPIRS10Y2017-02-272017-01-24USDUSD2017-02-27OTUS02027-02-27PPYINTRATEMVANILLAIMMCDSTRSSN]
[secName] [USD 0f10Y Pay Fixed - 27/02/2017]
[secTypeCd] [SWAPIRS]
[swapTenor] [10Y]
[effectiveDate] [2017-02-27]
[firstPaymentDate] [2017-01-24]
[locCrrncyCd] [USD]
[assetCrrncyCd] [USD]
[issueDate] [2017-02-27]
[listExchCd] [OTUS]
[couponRate] [0]
[couponBDAdj] []
[matureDate] [2027-02-27]
[swapSecInd] [P]
[swapLegInd] [P]
[otcClearEligInd] [Y]
[crrncyPairRate] []
[swapType] [INTRATE]
[mktPrice] []
[autoManualCalcFlag] [M]
[swapSubType] [VANILLA]
[dateGenMethod] [IMMCDS]
[prinRcvryRate] []
[issueDateAdj] []
[matDateAdj] []
[prinExchCd] []
[exCouponLag] []
[delayDays] []
[underlyingSecurity] []
[udfChar_29] [TRSSN]
[envelope/swapSecurityService/rcvLegSec]
[rcvLegSec] [Receive US0003MFRNSWUSDUSD2017-01-2483203384OTUSVARRTNEXTBD_EOM32017-01-242017-01-24LRINTRATEQQEOMOTUS322TRSSNIMMCDS]
[secName] [Receive US0003M]
[secTypeCd] [FRNSW]
[locCrrncyCd] [USD]
[assetCrrncyCd] [USD]
[issueDate] [2017-01-24]
[rateBasisSecid] [83203384]
[listExchCd] [OTUS]
[accrualTypCd] [VARRT]
[couponRate] []
[couponBDAdj] [NEXTBD_EOM]
[dayBasis] [3]
[firstPaymentDate] [2017-01-24]
[matureDate] [2017-01-24]
[swapSecInd] [L]
[swapLegInd] [R]
[crrncyPairRate] []
[swapType] [INTRATE]
[swapSubType] []
[paymentFreq] [Q]
[vrdnFreqCd] [Q]
[couponEOMFlag] [EOM]
[payDtHolExchCd] [OTUS]
[compoundingMethod] [3]
[resetLagDays] [2]
[resetLagBD] []
[dualCurveStrippingInd] []
[issueDateAdj] []
[cashflowParticipRate] []
[resetBDAdj] []
[resetRateConv] []
[udf] [2]
[udfChar_29] [TRSSN]
[dateGenMethod] [IMMCDS]
[envelope/swapSecurityService/payLegSec]
[payLegSec] [Pay Fixed 0%CBSWUSDUSD2017-01-24OTUSFIXRT0NEXTBD_EOM132017-01-242017-01-24XPINTRATESSEOMOTUS322TRSSNIMMCDS]
[secName] [Pay Fixed 0%]
[secTypeCd] [CBSW]
[locCrrncyCd] [USD]
[assetCrrncyCd] [USD]
[issuerId] []
[issueDate] [2017-01-24]
[rateBasisSecid] []
[listExchCd] [OTUS]
[accrualTypCd] [FIXRT]
[couponRate] [0]
[couponBDAdj] [NEXTBD_EOM]
[dayBasis] [13]
[firstPaymentDate] [2017-01-24]
[matureDate] [2017-01-24]
[swapSecInd] [X]
[swapLegInd] [P]
[crrncyPairRate] []
[swapType] [INTRATE]
[swapSubType] []
[paymentFreq] [S]
[vrdnFreqCd] [S]
[couponEOMFlag] [EOM]
[payDtHolExchCd] [OTUS]
[compoundingMethod] [3]
[resetLagDays] [2]
[resetLagBD] []
[dualCurveStrippingInd] []
[issueDateAdj] []
[cashflowParticipRate] []
[resetBDAdj] []
[resetRateConv] []
[udf] [2]
[udfChar_29] [TRSSN]
[dateGenMethod] [IMMCDS]
[secName] [USD 0f10Y Pay Fixed - 27/02/2017]
[secTypeCd] [SWAPIRS]
[swapTenor] [10Y]
[effectiveDate] [2017-02-27]
[firstPaymentDate] [2017-01-24]
[locCrrncyCd] [USD]
[assetCrrncyCd] [USD]
[issueDate] [2017-02-27]
[listExchCd] [OTUS]
[couponRate] [0]
[couponBDAdj] []
[matureDate] [2027-02-27]
[swapSecInd] [P]
[swapLegInd] [P]
[otcClearEligInd] [Y]
[crrncyPairRate] []
[swapType] [INTRATE]
[mktPrice] []
[autoManualCalcFlag] [M]
[swapSubType] [VANILLA]
[dateGenMethod] [IMMCDS]
[prinRcvryRate] []
[issueDateAdj] []
[matDateAdj] []
[prinExchCd] []
[exCouponLag] []
[delayDays] []
[underlyingSecurity] []
[udfChar_29] [TRSSN]
[secName] [Receive US0003M]
[secTypeCd] [FRNSW]
[locCrrncyCd] [USD]
[assetCrrncyCd] [USD]
[issueDate] [2017-01-24]
[rateBasisSecid] [83203384]
[listExchCd] [OTUS]
[accrualTypCd] [VARRT]
[couponRate] []
[couponBDAdj] [NEXTBD_EOM]
[dayBasis] [3]
[firstPaymentDate] [2017-01-24]
[matureD
Member 15254125
26-Jun-21 0:11am
View
Deleted
Hey Nguyen,
Yes. Let me send you the datatable which need to be converted to JSON string as per the hierarchy shown in XML as below:
[envelope]
[auth]
[user] [CRD_IPEMA]
[password] [CRD_IPEMA]
[session] [session1]
[/auth]
[swapSecurityService]
[envelope/swapSecurityService/parentSec]
[parentSec] [USD 0f10Y Pay Fixed - 27/02/2017SWAPIRS10Y2017-02-272017-01-24USDUSD2017-02-27OTUS02027-02-27PPYINTRATEMVANILLAIMMCDSTRSSN]
[secName] [USD 0f10Y Pay Fixed - 27/02/2017]
[secTypeCd] [SWAPIRS]
[swapTenor] [10Y]
[effectiveDate] [2017-02-27]
[firstPaymentDate] [2017-01-24]
[locCrrncyCd] [USD]
[assetCrrncyCd] [USD]
[issueDate] [2017-02-27]
[listExchCd] [OTUS]
[couponRate] [0]
[couponBDAdj] []
[matureDate] [2027-02-27]
[swapSecInd] [P]
[swapLegInd] [P]
[otcClearEligInd] [Y]
[crrncyPairRate] []
[swapType] [INTRATE]
[mktPrice] []
[autoManualCalcFlag] [M]
[swapSubType] [VANILLA]
[dateGenMethod] [IMMCDS]
[prinRcvryRate] []
[issueDateAdj] []
[matDateAdj] []
[prinExchCd] []
[exCouponLag] []
[delayDays] []
[underlyingSecurity] []
[udfChar_29] [TRSSN]
[envelope/swapSecurityService/rcvLegSec]
[rcvLegSec] [Receive US0003MFRNSWUSDUSD2017-01-2483203384OTUSVARRTNEXTBD_EOM32017-01-242017-01-24LRINTRATEQQEOMOTUS322TRSSNIMMCDS]
[secName] [Receive US0003M]
[secTypeCd] [FRNSW]
[locCrrncyCd] [USD]
[assetCrrncyCd] [USD]
[issueDate] [2017-01-24]
[rateBasisSecid] [83203384]
[listExchCd] [OTUS]
[accrualTypCd] [VARRT]
[couponRate] []
[couponBDAdj] [NEXTBD_EOM]
[dayBasis] [3]
[firstPaymentDate] [2017-01-24]
[matureDate] [2017-01-24]
[swapSecInd] [L]
[swapLegInd] [R]
[crrncyPairRate] []
[swapType] [INTRATE]
[swapSubType] []
[paymentFreq] [Q]
[vrdnFreqCd] [Q]
[couponEOMFlag] [EOM]
[payDtHolExchCd] [OTUS]
[compoundingMethod] [3]
[resetLagDays] [2]
[resetLagBD] []
[dualCurveStrippingInd] []
[issueDateAdj] []
[cashflowParticipRate] []
[resetBDAdj] []
[resetRateConv] []
[udf] [2]
[udfChar_29] [TRSSN]
[dateGenMethod] [IMMCDS]
[envelope/swapSecurityService/payLegSec]
[payLegSec] [Pay Fixed 0%CBSWUSDUSD2017-01-24OTUSFIXRT0NEXTBD_EOM132017-01-242017-01-24XPINTRATESSEOMOTUS322TRSSNIMMCDS]
[secName] [Pay Fixed 0%]
[secTypeCd] [CBSW]
[locCrrncyCd] [USD]
[assetCrrncyCd] [USD]
[issuerId] []
[issueDate] [2017-01-24]
[rateBasisSecid] []
[listExchCd] [OTUS]
[accrualTypCd] [FIXRT]
[couponRate] [0]
[couponBDAdj] [NEXTBD_EOM]
[dayBasis] [13]
[firstPaymentDate] [2017-01-24]
[matureDate] [2017-01-24]
[swapSecInd] [X]
[swapLegInd] [P]
[crrncyPairRate] []
[swapType] [INTRATE]
[swapSubType] []
[paymentFreq] [S]
[vrdnFreqCd] [S]
[couponEOMFlag] [EOM]
[payDtHolExchCd] [OTUS]
[compoundingMethod] [3]
[resetLagDays] [2]
[resetLagBD] []
[dualCurveStrippingInd] []
[issueDateAdj] []
[cashflowParticipRate] []
[resetBDAdj] []
[resetRateConv] []
[udf] [2]
[udfChar_29] [TRSSN]
[dateGenMethod] [IMMCDS]
[secName] [USD 0f10Y Pay Fixed - 27/02/2017]
[secTypeCd] [SWAPIRS]
[swapTenor] [10Y]
[effectiveDate] [2017-02-27]
[firstPaymentDate] [2017-01-24]
[locCrrncyCd] [USD]
[assetCrrncyCd] [USD]
[issueDate] [2017-02-27]
[listExchCd] [OTUS]
[couponRate] [0]
[couponBDAdj] []
[matureDate] [2027-02-27]
[swapSecInd] [P]
[swapLegInd] [P]
[otcClearEligInd] [Y]
[crrncyPairRate] []
[swapType] [INTRATE]
[mktPrice] []
[autoManualCalcFlag] [M]
[swapSubType] [VANILLA]
[dateGenMethod] [IMMCDS]
[prinRcvryRate] []
[issueDateAdj] []
[matDateAdj] []
[prinExchCd] []
[exCouponLag] []
[delayDays] []
[underlyingSecurity] []
[udfChar_29] [TRSSN]
[secName] [Receive US0003M]
[secTypeCd] [FRNSW]
[locCrrncyCd] [USD]
[assetCrrncyCd] [USD]
[issueDate] [2017-01-24]
[rateBasisSecid] [83203384]
[listExchCd] [OTUS]
[accrualTypCd] [VARRT]
[couponRate] []
[couponBDAdj] [NEXTBD_EOM]
[dayBasis] [3]
[firstPaymentDate] [2017-01-24]
[matureD
Member 15254125
24-Jun-21 7:44am
View
Hi Nguyen,
I have tried your way to add tags before serializing the dictionary of data table rows (which contains tag in column 1 and element value in column 2); It throwed the same error.
To explain the problem in full:
I have a datatable whose rows has (XML tags in column 1 and XML Element value in column 2).
My task is to convert the datatable into JSON string with complete hierarchy intact between parent and child nodes. The same JSON string can then be deserialized to well formed XML.
Member 15254125
20-Jun-21 8:28am
View
Original json string looks like this:
[{
"secTypeCd": "SWAPIRS"
},
{
"swapTenor": "10Y"
}]
I am ok to use some other library other than NewtonSoft.
In order to get this XMl construct:
<envelope><sectypecd>SWAPIRS<swaptenor>10Y<effectivedate>2017-02-27<envelope>
Member 15254125
20-Jun-21 8:13am
View
Thanks Richard, I got it!
I have now got a json string which must be wrapped with start tag <element> and end tag to create xml construct but it is getting added like this.
<envelope><sectypecd>SWAPIRS<envelope><swaptenor>10Y<envelope><effectivedate>2017-02-27<envelope><firstpaymentdate>2017-01-24<envelope>
I have tried to code it using this:
xml = JsonConvert.DeserializeXmlNode("{\"envelope\":" + JSONstring + "}", "envelope");
expected is like this:
<envelope><sectypecd>SWAPIRS<swaptenor>10Y<effectivedate>2017-02-27<firstpaymentdate>2017-01-24<envelope>
Member 15254125
20-Jun-21 5:15am
View
Hi Richard,
Thanks for the prompt reply!
I have checked the code after implementing Remove() method earlier as well but the string format showed '[<xmlnode>]' as key and '[<xmlelementvalue>]' as Value
Show More