|
Give this a shot...
((?: \w | \d | @ | - | _ | \. | ')+)
the (?: ) groups the alternatives without capturing. The outer () capture the full string.
|
|
|
|
|
when i want to receive fom MSMQ this exception comes(Generic Exception was thrown :system.xml:data at the root level is invalid. line 1, position 1.),
the problem comes because i was send message from old MSMQ, can any one tell me how to resolve this ?
is xml that used with old msmq not work with xml that used with new msmq?
is there any way to fix this problem ?
|
|
|
|
|
Hi guys,
I want to write a xslt code that creates a csv file (with all output in it) & saves to a particular folder without any manual intervention.
I've been looking xslt function definitions for file processing but with no success.
Could anyone throw me the snippet please
Thanks
Mohan
|
|
|
|
|
There are no XSLT functions for file processing - XSLT is not a system programming language. You can only save the result (using any other -system-level- language) coming from your XSLT processor.
Dmitry.
-------------------------
Don't worry, be happy )
|
|
|
|
|
Hi,
I'm looking for resource on calling xsl(or xslt) from c++, i'd been looking this for a week almost & haven't come across a good usefull one.
So could some one please let me know, even a code snippet will do.
Thanks.
Mohan
|
|
|
|
|
Here is one:
(making XSLT transform with MSXML. C++ sample is 3rd from top)
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/xmlsdk/html/af1fe9e0-b3f4-4ea1-8b6c-ab25a619be59.asp
Dmitry.
-------------------------
Don't worry, be happy )
|
|
|
|
|
I am attempting to extract some data from the xml below with the following code:
XPathDocument xmlDoc = new XPathDocument(URL that I supply);
XPathNavigator nav = xmlDoc.CreateNavigator();
nav.Select("/ISBNdb/BookList/BookData/AuthorsText");
Console.WriteLine(nav.Value);
The problem is the value returned is all of the elements concatenated together:
Applied Microsoft. NET framework programming in Microsoft Visual Basic. NETJeffrey Richter, Francesco BalenaRedmond, Wash. : Microsoft Press, c2003.
I have tried everthing and have no idea why I am getting this behavior. Any help would be greatly appreciated. Thanks.
Gary
This is the xml that is loaded into the XPathDocument:
<ISBNdb server_time="2006-05-03T12:48:06">
<BookList total_results="1" page_size="10" page_number="1" shown_results="1">
<BookData book_id="applied_microsoft_net_framework_programming_in_microsoft_vis" isbn="0735617872">
<Title>Applied Microsoft. NET framework programming in Microsoft Visual Basic. NET</Title>
<TitleLong></TitleLong>
<AuthorsText>Jeffrey Richter, Francesco Balena</AuthorsText>
<PublisherText publisher_id="microsoft_press">Redmond, Wash. : Microsoft Press, c2003.</PublisherText>
<Details dewey_decimal="005.2/76" physical_description_text="xxxii, 609 p. : ill. ; 23 cm." language="eng" edition_info="" dewey_decimal_normalized="5.276" lcc_number="QA76.625" change_time="2003-10-23T02:17:24" price_time="2006-05-02T20:31:22" />
</BookData>
</BookList>
</ISBNdb>
-- modified at 10:50 Friday 5th May, 2006
|
|
|
|
|
You should use the XPathNodeIterator which is returned from the Select method, not the Value of the navigator.
private void Form1_Load(object sender, System.EventArgs e)
{
XPathDocument xmlDoc = new XPathDocument("..\\..\\data.xml");
XPathNavigator nav = xmlDoc.CreateNavigator();
XPathNodeIterator iter = nav.Select("/ISBNdb/BookList/BookData/AuthorsText");
while( iter.MoveNext() )
Console.WriteLine(iter.Current.Value);
}
Josh
|
|
|
|
|
I tried that as well. I got the same exact result. Did it work correctly for you?
|
|
|
|
|
|
VS 2003 or VS 2005? I am using 2003. Any thoughts on why it would work for you and not me? Thanks!
|
|
|
|
|
2003. I don't know what the difference could be. I posted the exact code that worked for me, so it must be an Act of God.
Josh
|
|
|
|
|
I enjoyed the sense of humor.
|
|
|
|
|
I tried Josh's code in 1.1 and it worked as advertised!
|
|
|
|
|
SushantMathur wrote: a tree view in xsl using javascript
You might try rephrasing that since you recieved no replies. For myself that question makes no sense.
"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
|
|
|
|
|
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; ============================
|
|
|
|