|
SushantMathur wrote: don't understand what rephrasing you are saying about????
It seems you do.... since you did!
SushantMathur wrote: this question means i want to display my xml data into HTML format with tree view structure.
This should help get you started: http://www.codeproject.com/jscript/dhtml_treeview.asp[^]
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum
led mike
|
|
|
|
|
Ok, I have a predefined XML set that looks like the following:
<?xml version="1.0" encoding="UTF-8"?><Order_Invoice_Outgoing_Array_Element><Order_Invoice_Outgoing_Element><interface_transaction>11767</interface_transaction><order_Invoice_Header><vendor>999964</vendor><invoice>AM12345</invoice><currency>USD</currency><invoice_Category>ORDER</invoice_Category><invoice_Date>2006-05-01T00:00:00.000-04:00</invoice_Date><invoice_Due_Date>2006-05-31T00:00:00.000-04:00</invoice_Due_Date><terms>NET30</terms><invoice_Amount_Total>745.26</invoice_Amount_Total><status>CLOSED</status><currency_Exchange_Rate>1</currency_Exchange_Rate><order_Type_Optional>PO</order_Type_Optional><order_Number_Optional>88001233</order_Number_Optional><pay_Indicator>AP</pay_Indicator><original_Invoice_Amount>745.26</original_Invoice_Amount><GL_Account /><voucher>1</voucher><created_By>AMORENO</created_By><created_Date>2006-05-01T19:01:54.000-04:00</created_Date><modified_By>AMORENO</modified_By><modified_Date>2006-05-01T19:10:12.000-04:00</modified_Date><line_Sum>745.26</line_Sum><AP_System_Received_Flag>false</AP_System_Received_Flag><paid_Flag>false</paid_Flag></order_Invoice_Header><order_Invoice_Lines><order_Invoice_Line><order_Type>PO</order_Type><order_Line>1</order_Line><order_Number>88001233</order_Number><invoice_Category>ORDER</invoice_Category><invoice_Date>2006-05-01T00:00:00.000-04:00</invoice_Date><invoice_Amount>745.26</invoice_Amount><invoiced_Qty>1</invoiced_Qty><GL_Account><GL_Company>160811</GL_Company><GL_Expenditure>0</GL_Expenditure><GL>0</GL><GL_Cost_Center>0</GL_Cost_Center><GL_Description>AIRFRAME ROTABLES - A300</GL_Description><GL_Category>ALL</GL_Category><modified_By>GLACCOUNT</modified_By></GL_Account><status>PAID</status><credit_Memo_Cost>0</credit_Memo_Cost><created_By>AMORENO</created_By><created_Date>2006-05-01T19:02:42.000-04:00</created_Date><modified_By>AMORENO</modified_By><modified_Date>2006-05-01T19:10:12.000-04:00</modified_Date><line_Amount>745.26</line_Amount><location>ILN</location><Order_Detail_Lines><Order_Detail_Line><order_Line>1</order_Line><delivery_Date>2006-05-31T00:00:00.000-04:00</delivery_Date><PN><PN_Interchangeable>622-0118-001</PN_Interchangeable><PN_Main>622-0118-001</PN_Main><PN_Category>ARA300B4</PN_Category></PN><QTY_Require>1</QTY_Require><unit_Of_Measurement>EA</unit_Of_Measurement><unit_Cost>745.26</unit_Cost><modified_Date>2006-05-01T19:00:22.000-04:00</modified_Date><ship_To_Location>ILN</ship_To_Location><capital_Expenditure>280-041-001</capital_Expenditure></Order_Detail_Line></Order_Detail_Lines></order_Invoice_Line></order_Invoice_Lines></Order_Invoice_Outgoing_Element><Order_Invoice_Outgoing_Element><interface_transaction>11773</interface_transaction><order_Invoice_Header><vendor>P00001</vendor><invoice>AM00123</invoice><currency>USD</currency><invoice_Category>ORDER</invoice_Category><invoice_Date>2006-05-01T00:00:00.000-04:00</invoice_Date><invoice_Due_Date>2006-05-31T00:00:00.000-04:00</invoice_Due_Date><terms>NET30</terms><invoice_Amount_Total>512.7</invoice_Amount_Total><status>CLOSED</status><currency_Exchange_Rate>1</currency_Exchange_Rate><order_Type_Optional>RO</order_Type_Optional><order_Number_Optional>88001234</order_Number_Optional><pay_Indicator>AP</pay_Indicator><original_Invoice_Amount>512.7</original_Invoice_Amount><GL_Account /><voucher>2</voucher><created_By>AMORENO</created_By><created_Date>2006-05-01T19:42:17.000-04:00</created_Date><modified_By>AMORENO</modified_By><modified_Date>2006-05-01T19:51:09.000-04:00</modified_Date><line_Sum>512.7</line_Sum><AP_System_Received_Flag>false</AP_System_Received_Flag><paid_Flag>false</paid_Flag></order_Invoice_Header><order_Invoice_Lines><order_Invoice_Line><order_Type>RO</order_Type><order_Line>2</order_Line><order_Number>88001234</order_Number><invoice_Category>ORDER</invoice_Category><invoice_Date>2006-05-01T00:00:00.000-04:00</invoice_Date><invoice_Amount>256.35</invoice_Amount><invoiced_Qty>1</invoiced_Qty><GL_Account><GL_Company>443120</GL_Company><GL_Expenditure>809</GL_Expenditure><GL>A300B4</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>PAID</status><resolved_By>AMORENO</resolved_By><resolved_On>2006-05-01T19:45:22.000-04:00</resolved_On><credit_Memo_Cost>0</credit_Memo_Cost><created_By>AMORENO</created_By><created_Date>2006-05-01T19:43:45.000-04:00</created_Date><modified_By>AMORENO</modified_By><modified_Date>2006-05-01T19:51:09.000-04:00</modified_Date><line_Amount>256.35</line_Amount><location>ILN</location><Order_Detail_Lines><Order_Detail_Line><order_Line>2</order_Line><delivery_Date>2006-06-05T00:00:00.000-04:00</delivery_Date><PN><PN_Interchangeable>622-0118-001</PN_Interchangeable><PN_Main>622-0118-001</PN_Main><PN_Category>ARA300B4</PN_Category></PN><QTY_Require>1</QTY_Require><unit_Of_Measurement>EA</unit_Of_Measurement><unit_Cost>0</unit_Cost><modified_Date>2006-05-01T19:38:59.000-04:00</modified_Date><SN>34567</SN><batch>328255</batch><ship_To_Location>ILN</ship_To_Location><capital_Expenditure>315-042-011</capital_Expenditure></Order_Detail_Line></Order_Detail_Lines></order_Invoice_Line><order_Invoice_Line><order_Type>RO</order_Type><order_Line>1</order_Line><order_Number>88001234</order_Number><invoice_Category>ORDER</invoice_Category><invoice_Date>2006-05-01T00:00:00.000-04:00</invoice_Date><invoice_Amount>256.35</invoice_Amount><invoiced_Qty>1</invoiced_Qty><GL_Account><GL_Company>443120</GL_Company><GL_Expenditure>809</GL_Expenditure><GL>A300B4</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>PAID</status><credit_Memo_Cost>0</credit_Memo_Cost><created_By>AMORENO</created_By><created_Date>2006-05-01T19:43:45.000-04:00</created_Date><modified_By>AMORENO</modified_By><modified_Date>2006-05-01T19:51:09.000-04:00</modified_Date><line_Amount>256.35</line_Amount><location>ILN</location><Order_Detail_Lines><Order_Detail_Line><order_Line>1</order_Line><delivery_Date>2006-06-05T00:00:00.000-04:00</delivery_Date><PN><PN_Interchangeable>622-0118-001</PN_Interchangeable><PN_Main>622-0118-001</PN_Main><PN_Category>ARA300B4</PN_Category></PN><QTY_Require>1</QTY_Require><unit_Of_Measurement>EA</unit_Of_Measurement><unit_Cost>256.35</unit_Cost><modified_Date>2006-05-01T19:38:15.000-04:00</modified_Date><SN>23456</SN><batch>328254</batch><ship_To_Location>ILN</ship_To_Location><capital_Expenditure>280-052-017</capital_Expenditure></Order_Detail_Line></Order_Detail_Lines></order_Invoice_Line></order_Invoice_Lines></Order_Invoice_Outgoing_Element></Order_Invoice_Outgoing_Array_Element>
My program grabs this XML which is returned as a String type fom a 3rd party API and then must parse it and insert it into another database. I am able to populate a Tree View with the information but anytime I try to add the XML to a dataset I get "Illegal Characters in Path" errors or "Child list for field Order_Invoice_Outgoing_Array_Element cannot be created"...
Generally it is the later when using the code listed below.
Here is the code I am using to pull the XML:
<pre>
WindowsApplication1.aero.trax.weblogs.order_invoice_service.Order_Invoice_ServiceService service = new WindowsApplication1.aero.trax.weblogs.order_invoice_service.Order_Invoice_ServiceService();
WindowsApplication1.aero.trax.weblogs.order_invoice_service.Order_Invoice_Query_Parameter_Element query = new WindowsApplication1.aero.trax.weblogs.order_invoice_service.Order_Invoice_Query_Parameter_Element();
service.Timeout = 100000000;
query.getOnlyUnSentRecords = true;
String s_invoices;
s_invoices = service.queryRecordsReturnString(query);
XmlDocument doc = new XmlDocument();
doc.InnerXml = s_invoices;
XmlElement root = doc.DocumentElement;
treeView1.Nodes.Clear();
treeView1.Nodes.Add(new TreeNode(doc.DocumentElement.Name));
TreeNode tNode = new TreeNode();
tNode = treeView1.Nodes[0];
AddNode(doc.DocumentElement, tNode);
treeView1.ExpandAll();
DataSet myData = new DataSet();
dataGridView1.DataSource = doc.DocumentElement;
dataGridView1.DataMember = "Order_Invoice_Outgoing_Array_Element";
dataGridView1.Refresh();
</pre>
Now here is one method I am using to populate the Recordset that is failing (basically any method I use fails)...
Also, if I modify the code to actually use the dataset and XML data as follows:
myData.WriteXml(doc.InnerXml);
dataGridView1.DataSource = myData;
dataGridView1.DataMember = "Order_Invoice_Outgoing_Array_Element";
dataGridView1.Refresh();
That is when I get the illegal characters in path error...
-- modified at 10:28 Wednesday 3rd May, 2006
|
|
|
|
|
I am not sure what you are trying to do but if you are trying to edit the XML you recieve as a string in a DataGridView you might consider trying something like this:
DataSet ds = new DataSet();<br />
string s_invoices = string.Empty; <br />
System.IO.StringReader reader = new System.IO.StringReader(s_invoices);<br />
ds.ReadXml( reader);<br />
dataGridView1.DataSource = ds;<br />
"What classes are you using ? You shouldn't call stuff if you have no idea what it does" Christian Graus in the C# forum
led mike
|
|
|
|
|
Kindly help me with the following queries:
I'm using MSXML 4.0 in the SAX(2) parsing mode. I'm working on a desktop application in C++. Request you to resolve the following queries?
1. Does MSXML offers an equivalent of XMLUni::fgSAX2CoreValidation feature provided by the Xerces-c parser? From my understanding, the schema validation in xerces is configured using the XMLUni::fgXercesSchema and XMLUni::fgXercesSchemaFullChecking features and in MSXML same is done using the IXMLDOMSchemaCollection2Ptr interface and the schema-validation feature. However, I could not figure out a feature/property in MSXML corresponding to the coreValidation feature of the Xerces-c parser. MSDN states that MSXML 3.0 does not support setting of the "http://xml.org/sax/features/validation" feature. The same when tried using MSXML 4.0 also returns E_INVALIDARG.
2. The call to IXMLDOMSchemaCollection2Ptr->add () fails with a file not found (-2146697210) error. Could you please tell what should be passed as the namespace, and whether passing name of the DTD alone as the second parameter would be sufficient. {Is their some way through which the referred DTD can be resolved by invoking the ResolveEntity () function of the EntityResolver at this point also - The same DTD when referred through the DOCTYPE declaration in the xml, is resolved through a call to ResolveEntity () which in turn fetches the contents of the DTD from a DLL that houses that DTD.} There is no way I can pass an absolute path to the DTD that is actually a resource in a DLL.
3. What is the recommended way to populate the pointer to VARIANT, which is an Out parameter to the ResolveEntity () function of the EntityResolver. On using the CopyTo function on a local CCOMBstr, a constant memory leak is reported on every parsing-iteration of the same XML. Upon reaching a high number of iterations, the parser randomly (or, maybe it follows a pattern) stops reporting elements of the XML being parsed to the ContentHandler. Is this something to do with the Delayed Garbage Collection of MSXML? Could some one please tell how to disable this feature.
Satnam Singh Anand
-- modified at 8:16 Wednesday 3rd May, 2006
|
|
|
|
|
Hi,
i have just completed a xsd schema and could not wait to get my hands to the new xmlObjectDataSource and was slapped in the face when i realized that i can not use the xmlObjectDataSource with an xmlnamespace ( DO WHAT ? )
Anyway, i am hoping that someone can help tell me how to do this without removing the namespace?
erik
|
|
|
|
|
( writed as C++ )
Description of class CXmlFile :
+ Data members :
m_tagRoot // Stores root tag (master tag) of the xml file
+ Construction & destruction
CXmlFile //Contructs a CXmlFile objiects
~CXmlFile //Destructs a CXmlFile objiect
+ Operations
LoadTags //Loads the root tag and its child tags in an xml file into memory and store the root tag in m_tagRoot member.
Open //Opens an xml file. This method is also used to creat a new xml file.
close //Closes an xml file.
GetRootTag //Returns pointer point to the root tag.
+ Status
IsReadMode //Returns bool value which specifies whether the xml file is in read mode.
IsWriteMode //Returns bool value which specifies whether the xml file is in write mode.
Thanks ! ^_^
My Email : vietsoft2006@yahoo.com
Perseverance for success !
Myhomepage : http://www.bacninh.tk
Welcome my countryside !
My Email : vietsoft2005@yahoo.com
-- modified at 23:45 Friday 28th April, 2006
|
|
|
|
|
I'm not shure if this is the right place to post this message...
I'm trying to align my tables as to display them next to each other. The reason for my not all in one table is because i dont know the amount of columns or rows and thus dump all the data in one of each staff members table.
I can align the tables in xml and xsl, the problem i'm having is when i try to align the tables in FOP(Formatting Objects Processing) to create a pdf.
Does anyone know how to align tables next to each other in FOP. I've read up on how to align them beneath each other but i can't find an example of one where they are next to each other.
Plz help, any and all comments will be appreciated.
He who laughs last...
|
|
|
|
|
Enjoy the long weekend
He who laughs last...
|
|
|
|
|
suppose i have the folloing XML:
<bookstore>
<book>
<title> AAA</title>
<author> bbb</author>
<price> 40 </price>
</book>
</bookstore>
& i want "title" for example as a return element, at the same time it is the predicate element.. how to make this expression?
i tried:
//title[.='AAA']
& it didn't work?!
|
|
|
|
|
Hi!
try the following...
bookstore/book/title
It will return u the value - AAA
============================ A finite loop!
for (int i=0; i<=1; i++) if (i == 1) i = 0; ============================
|
|
|
|
|
Try //title[text()='AAA']?
|
|
|
|
|
Think Stuart is nearly correct, but it does not reach the correct depth.
/bookstore/book/title =>
So 3 '/' is needed if absolute paths are needed, or '.' in front if relative from /bookstore is required.
Absolute:
Relative from /bookstore:
.
-- modified at 21:39 Thursday 27th April, 2006
|
|
|
|
|
thank u all
i went with the last soloution,absolute didn't work
|
|
|
|
|
Graham N wrote:
/bookstore/book/title => ///title
Should be:
/*/*/title
Graham N wrote:
.//title[text()='AAA']
.//title All <title> elements one or more levels deep in the current context
//title Recursive descent; searches for <title> elements at any depth. When this path operator appears at the start of the pattern, it indicates recursive descent from the root node.
So, .//title only works when the current has <title> elements as descendants.
Thus, Stuart is correct and you are nearly correct.
-- modified at 23:37 Friday 28th April, 2006
|
|
|
|
|
Ah yes!
Now that would make more sense.
It's been a while since I've done any major XML projects.
|
|
|
|
|
Hi,
In order to display logdata stored in a single xml file in a pretty way I would like to use different xsl stylesheets transforming the xml file. Each XSL file extracts a certain aspect (system information, Process information)
I would like to create a html side having a coule of links on it. Each one of them should load a xml file with a different style sheet. While browing the usual newsgroups i found out that this should be possible using javascript but how? I would like to get more details on that, so can anyone point me in the right direction?
Thanks in advance
Ingo
|
|
|
|
|
Greetings all.
Is it possible to create a schema to enforce the following issue.
If the value for required Attribute A within Element E has an enumerated value of ‘myType’ then element E also needs to have Attribute B.
Xml example below
E=Item
A=type
B=len
<Items>
<Item type=” myType” len=”5” />
<Item type=” NOTmyType” />
</Items>
Any help or a point in a semi right direction would be very helpful
-- modified at 11:27 Tuesday 25th April, 2006
|
|
|
|
|
Not with XSD, IMO - you'd need something like Schematron[^]
|
|
|
|
|
was afraid of that.
thanks for the validation
is it then common practice to have different node names to start with, and not differentiate by node type?
|
|
|
|
|
Mmmmm - yes, I guess so. Otherwise you leave verification of semantic constraints (such as the one you want to enforce) to a stage *after* XSD validation.
|
|
|
|
|
i have to import inside a sql server 2005 table a file excel saved as an xml with a column with some strings.
column
-------
sfsdfsfd
dsfsfgg
54432fd
dss43r
gdgdgdfgd43
gdfgdfg43
etc...
how can i do?
|
|
|
|
|
how can i use / in the name of element, like < I / O > < / I / O >, i am using c# and it is throwing exception.
Shajeel
-- modified at 9:09 Monday 24th April, 2006
|
|
|
|
|
|
You can't. It goes against W3C's XML specifications.
|
|
|
|
|
i was looking at the following tutorial's last topic Element Naming.
http://www.w3schools.com/xml/xml_elements.asp
it doesn't say anything about this restriction.
Shajeel
|
|
|
|