Click here to Skip to main content
15,915,093 members
Home / Discussions / XML / XSL
   

XML / XSL

 
QuestionEditing an XML node (C#) Pin
AnneThorne19-Apr-06 2:50
AnneThorne19-Apr-06 2:50 
GeneralRe: Editing an XML node (C#) Pin
George L. Jackson19-Apr-06 12:57
George L. Jackson19-Apr-06 12:57 
AnswerRe: Editing an XML node (C#) Pin
George L. Jackson19-Apr-06 13:22
George L. Jackson19-Apr-06 13:22 
AnswerRe: Editing an XML node (C#) Pin
Michael A. Barnhart21-Apr-06 15:35
Michael A. Barnhart21-Apr-06 15:35 
Questionxml to xsd validation in vbscript Pin
Selvakumar.R19-Apr-06 1:27
Selvakumar.R19-Apr-06 1:27 
AnswerRe: xml to xsd validation in vbscript Pin
Sushant_Mathur3-May-06 2:10
Sushant_Mathur3-May-06 2:10 
QuestionBuilding a database from an XML Schema Pin
mvartere18-Apr-06 5:52
mvartere18-Apr-06 5:52 
QuestionXML C# Question Pin
seschu0118-Apr-06 5:22
seschu0118-Apr-06 5:22 
Ok, I wasn't sure what board to put this so I am shooting here first as it is a c# code question:

I have the following XML Data that is returned from a 3rd party API. The resulting data is stored as a string and loaded into the XML dom as follows:

// s_invoices contains the XML
string s_invoices;
XmlDocument doc = new XmlDocument();
doc.InnerXml = s_invoices;
XmlElement root = doc.DocumentElement;

The XML itself looks like the following (sample):

<?xml version="1.0" encoding="UTF-8"?>
<Order_Invoice_Outgoing_Array_Element>
<Order_Invoice_Outgoing_Element>

<interface_transaction>18399</interface_transaction>
<transaction>18399</transaction>

<order_Invoice_Header>
<vendor>P00621</vendor>
<invoice>90951282</invoice>
<currency>USD</currency>
<invoice_Category>ORDER</invoice_Category>
<invoice_Date>2003-08-18T00:00:00.000-04:00</invoice_Date>
<invoice_Due_Date>2003-0818T00:00:00.00004:00</invoice_Due_Date>
<terms>NET30</terms>
<invoice_Amount_Total>6260</invoice_Amount_Total>
<status>CLOSED</status>
<currency_Exchange_Rate>1</currency_Exchange_Rate>
<order_Type_Optional>PO</order_Type_Optional>
<order_Number_Optional>40845</order_Number_Optional>
<pay_Indicator>AP</pay_Indicator>
<original_Invoice_Amount>0</original_Invoice_Amount>
<GL_Account>
<GL_Company>443120</GL_Company>
<GL_Expenditure>809</GL_Expenditure>
<GL>0</GL>
<GL_Cost_Center>0</GL_Cost_Center>
<GL_Description>REPAIR ORDERS</GL_Description>
<GL_Category>ALL</GL_Category>
<modified_By>GLACCOUNT</modified_By>
</GL_Account>

<voucher>78086</voucher>
<created_By>TGREEN</created_By>
<created_Date>2003-10-31T00:00:00.000-05:00</created_Date>
<modified_By>PFAPHSTN</modified_By>
<modified_Date>2006-03-19T00:00:00.000-05:00</modified_Date>
<line_Sum>6260</line_Sum>
<AP_System_Received_Flag>false</AP_System_Received_Flag>
<paid_Flag>true</paid_Flag>
<interface_Batch>14975</interface_Batch>
</order_Invoice_Header>

<order_Invoice_Lines>
<order_Invoice_Line>
<order_Type>PO</order_Type>
<order_Line>7</order_Line>
<order_Number>40845</order_Number>
<invoice_Category>ORDER</invoice_Category>
<invoice_Date>2003-08-18T00:00:00.000-04:00</invoice_Date>
<invoice_Amount>6260</invoice_Amount>
<invoiced_Qty>1</invoiced_Qty>
<GL_Account>
<GL_Company>443120</GL_Company>
<GL_Expenditure>809</GL_Expenditure>
<GL>0</GL>
<GL_Cost_Center>0</GL_Cost_Center>
<GL_Description>REPAIR ORDERS</GL_Description>
<GL_Category>ALL</GL_Category>
<modified_By>GLACCOUNT</modified_By>
</GL_Account>
<status>CLOSED</status>
<assigned_To>VHAINES</assigned_To>
<credit_Memo>78086</credit_Memo>
<credit_Memo_Cost>0</credit_Memo_Cost>
<original_Invoice_Amount>0</original_Invoice_Amount>
<created_By>TGREEN</created_By>
<created_Date>2003-10-31T00:00:00.000-05:00</created_Date>
<modified_By>PFAPHSHD</modified_By>
<modified_Date>2006-03-19T08:39:39.000-05:00</modified_Date>
<line_Amount>6260</line_Amount>
</order_Invoice_Line>
</order_Invoice_Lines>

</Order_Invoice_Outgoing_Element>
</Order_Invoice_Outgoing_Array_Element>

So basically it is a very convoluted XML string. Now what I want to do is populate the XML into a form but am having problems finding what I am looking for.

I am currently using the following:

Console.WriteLine(" The terface_transaction : {0}", root.GetAttribute("//Order_Invoice_Outgoing_Array_Element/Order_Invoice_Outgoing_Element/interface_transaction"));

To try to write out just the interface transaction portion of the XML but alas it is not working. I am thinking it is because maybe GetAttribute is set to start at root and somehow my pathing is wrong, any ideas?




-- modified at 11:22 Tuesday 18th April, 2006
AnswerRe: XML C# Question Pin
George L. Jackson18-Apr-06 14:55
George L. Jackson18-Apr-06 14:55 
QuestionHelp Required from XML guys - XMLIsland Pin
Selvakumar.R17-Apr-06 20:49
Selvakumar.R17-Apr-06 20:49 
AnswerRe: Help Required from XML guys - XMLIsland Pin
Paddy Boyd17-Apr-06 23:50
Paddy Boyd17-Apr-06 23:50 
GeneralRe: Help Required from XML guys - XMLIsland Pin
Selvakumar.R18-Apr-06 1:57
Selvakumar.R18-Apr-06 1:57 
AnswerRe: Help Required from XML guys - XMLIsland Pin
George L. Jackson18-Apr-06 15:06
George L. Jackson18-Apr-06 15:06 
QuestionFOP Pin
Support12317-Apr-06 20:04
Support12317-Apr-06 20:04 
Questionfind rasult from xml Pin
discktopsultan@hotmail.com15-Apr-06 23:57
discktopsultan@hotmail.com15-Apr-06 23:57 
AnswerRe: find rasult from xml Pin
George L. Jackson17-Apr-06 3:19
George L. Jackson17-Apr-06 3:19 
GeneralRe: find rasult from xml Pin
discktopsultan@hotmail.com17-Apr-06 23:28
discktopsultan@hotmail.com17-Apr-06 23:28 
GeneralRe: find rasult from xml Pin
discktopsultan@hotmail.com18-Apr-06 1:55
discktopsultan@hotmail.com18-Apr-06 1:55 
GeneralRe: find rasult from xml Pin
George L. Jackson18-Apr-06 14:15
George L. Jackson18-Apr-06 14:15 
GeneralRe: find rasult from xml Pin
discktopsultan@hotmail.com18-Apr-06 23:36
discktopsultan@hotmail.com18-Apr-06 23:36 
QuestionI need a direction about XML/XSL/XSLT etc. Pin
Cristoff13-Apr-06 20:57
Cristoff13-Apr-06 20:57 
AnswerRe: I need a direction about XML/XSL/XSLT etc. Pin
Michael A. Barnhart14-Apr-06 11:49
Michael A. Barnhart14-Apr-06 11:49 
GeneralRe: I need a direction about XML/XSL/XSLT etc. Pin
Cristoff14-Apr-06 19:15
Cristoff14-Apr-06 19:15 
GeneralRe: I need a direction about XML/XSL/XSLT etc. Pin
Michael A. Barnhart15-Apr-06 1:25
Michael A. Barnhart15-Apr-06 1:25 
GeneralRe: I need a direction about XML/XSL/XSLT etc. Pin
Cristoff15-Apr-06 13:32
Cristoff15-Apr-06 13:32 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.