Quantcast
Channel: AX Developer Forum
Viewing all articles
Browse latest Browse all 9880

XML Header - Special Characters

$
0
0

Hello. I'm trying to product the following output: (the values aren't important...the format is)

<FILE file_id="20140318A" file_total_amount="1945.00" file_tran_count="10">
<BATCH batch_id="20140318" cust_nbr="2015" merch_nbr="1050339" dba_nbr="1" terminal_nbr="28680100" batch_total_amount="1945.00" batch_tran_count="10">
<DETAIL>
<ORIG_AUTH_GUID>TESTBRIC2</ORIG_AUTH_GUID>
<AMOUNT>165.00</AMOUNT>
<CARD_ENT_METH>Z</CARD_ENT_METH>
<TRAN_TYPE>CCM1</TRAN_TYPE>
<USER_DATA_1>10008930</USER_DATA_1>
<USER_DATA_2>360 VT Tech Ltd</USER_DATA_2>
<INVOICE_NBR>0102IN000007561</INVOICE_NBR>
<CURRENCY_CODE>978</CURRENCY_CODE>
<TRAN_NBR>1</TRAN_NBR>
</DETAIL>
</BATCH>
</FILE>
The problem is in the <File> and <Batch> tag part...I cannot get it to allow special characters such as the = or quotes between the < and >... I get:
ERROR: The '=' character, hexadecimal value 0x3D, cannot be included in a name.
Here's my code:

 

 

//concatenate <FILE> line in XML

fileStr =

 

"file_id='"+BatchLogTable.fileid+"' file_total_amount='"+num2str(myView.AmountCur,0,2,1,0)+"' file_tran_count='"+num2str(myView.RecId,0,0,1,0)+"'";

 

 

//concatenate <BATCH> line in XML

batchStr =

 

"batch_id='"+currDateStr+"'cust_nbr='"+dialogCustNum.value()+"'merch_nbr='"+dialogMerchNum.value()+"'dba_nbr='"+dialogDBANum.value()+"'terminal_nbr='"+dialogTermNum.value()+"'batch_total_amount='"+num2str(myView.AmountCur,0,2,1,0)+"'batch_tran_count='"+num2str(myView.RecId,0,0,1,0)+"'";

 

 

 

//start creation of XML

doc = XmlDocument::newBlank();

nodeFile = doc.createElement(fileStr

 

);

doc.appendChild(nodeFile);

nodeBatch = doc.createElement(batchStr);

nodeFile.appendChild(nodeBatch);

 

Everything after this works, so I didn't include it. If I remove the single quotes and equal signs from the fileStr and batchStr values, I don't get the error, but I need those so they can be read on the other end.

Any ideas?

thanks!


Viewing all articles
Browse latest Browse all 9880

Trending Articles