|
Hello Folks,
has somebody an Idea, why are there so huge Memory Problems ?
|
|
|
|
|
|
Hello maury_73,
you had the same Problem, Do you have now the Solution ?
Greetings, Markus
|
|
|
|
|
Sorry... I have the same problem
|
|
|
|
|
Is there a way to remove an attribute from the node?
|
|
|
|
|
|
I have one question about FindNode member of CXmlNodeWrapper class.
I find a query with XPath syntax but the answers are always empty ("" ).
I don't use xsl file and the xml file sample contents is:
<images>
<rect name="__rPageSence">
Norm=( 711, 575, 794, 594 )
<rect name="__rPageSence">
Norm=( 711, 575, 794, 594 )
High=( 935, 743, 1018, 762 )
<rect name="__rPageSence">
Norm=( 711, 575, 794, 594 )
High=( 935, 743, 1018, 762 )
Why the result seems to be wrong.
Thanks.
|
|
|
|
|
Please specify what XPath query you are using
Creative minds - create creative creations!
|
|
|
|
|
Hi. It's nice to see that you're publishing your work online.... But there should be more full examples of use this class...(let's say readnig some basics settings for program) This is probably easy..but not for your first contact with XML for C++
Regards.
Rafal
|
|
|
|
|
I am sorry but this is not a beginner article...
If you have any specific questions, you are welcome to ask them here.
Creative minds - create creative creations!
|
|
|
|
|
Isthere an easy way to return a single attribute value from an xpath query using this library? For instance:
/Root/AnElement[@author='XXXX']/@bookTitle
Seems the query completes successfully, but AsDocument fails (obviously). I currently have no way )I can see) to pull out the "bookTitle" attribute value
Thanks
|
|
|
|
|
Use the "GetValue" function
Creative minds - create creative creations!
|
|
|
|
|
I have searched a lot of C++ samples for XML but they were all a lot complex.
Til I saw your code I were upset how unreadable XML in C++ was.
Thanx a lot
PS: in CXMLViewDlg::ParseNode(...)
HTREEITEM hAttribItem = m_tree.InsertItem(node.GetAttribName(i) + " = " + node.GetAttribVal(i),3,4/*=>3*/,hItem);
//if selected theres isnt the 4.Icon
Greeting from Germany
-- modified at 8:08 Tuesday 11th April, 2006
|
|
|
|
|
WE agree you saved us......!
Thanx a lot from Greece
Vivi and Lefteris
|
|
|
|
|
Hello,
I use method CXmlDocumentWrapper::Save. When I open xml file in text editor I see:
<neuralnetwork><new_node somevalue3="Data_Item3">nodeText<new_node55>node5
Is it possibility to change xml formating text to
<neuralnetwork>
<new_node somevalue3="Data_Item3">nodeText
<new_node55>node5
Best regards
Mariusz K
|
|
|
|
|
Sorry to say but xml formating is not currently implemented...
To apply formating one needs to use XSL transformation on the document , similar to what Internet explorer does (check what happens when you open the xml document in IE)
One could write a method like "SaveFormated" which would apply a predefined XSL transformation on the document. I bealeave that there are ready XSL transforms on the internet that do that kind of transformation , if I'll get my hands free any time soon I'll write one myself and update the article.
Creative minds - create creative creations!
|
|
|
|
|
I have loaded the following XML into a String using the two lines of code shown below. I now need to extract the Address information of each candidate as a string. I have tried a few different methods but keep coming up with no value. Any idea I can populate the address information of each candidate into a string. Thanks in advance.
doc.Load( URL );
mGeoXML = doc.GetXML();
<?xml version="1.0" ?>
- <CdResults>
- <CdCandidates>
- <CdCandidate>
<txtStreet>A Street</txtStreet>
<txtCity>A City</txtCity>
<txtState>NY</txtState>
<txtZip>14150</txtZip>
<txtPlus4></txtPlus4>
<txtLon>-78.8728161862189</txtLon>
<txtLat>42.890780920576</txtLat>
<txtGeoResult>S5HPNTSC-A</txtGeoResult>
<txtFirm />
<txtCensusBlockId>360290072011012</txtCensusBlockId>
<txtPrecision>20</txtPrecision>
</CdCandidate>
- <CdCandidate>
<txtStreet>Street 2</txtStreet>
<txtCity>City 2</txtCity>
<txtState>NY</txtState>
<txtZip>14223</txtZip>
<txtPlus4></txtPlus4>
<txtLon>-78.7527337771572</txtLon>
<txtLat>42.8337338423022</txtLat>
<txtGeoResult>S5HPNTSC-A</txtGeoResult>
<txtFirm />
<txtCensusBlockId>360290118002005</txtCensusBlockId>
<txtPrecision>20</txtPrecision>
</CdCandidate>
-- modified at 10:28 Friday 17th February, 2006
|
|
|
|
|
Hello Alex,
Thanks for sharing your code, I'm learning a lot from it.
I would sugest that you add also into the article documentation the need of the CoInitialize() in order to work, I noticed this only after trying your code without success and then saw the use of CoInitialize() in your demo dialog application that was missing for me. (Confirmed by an answer you provided in this forum as well).
I noticed that the demo code is not synchronized with the latest XmlNodeWrapper.h and XmlNodeWrapper.h files, although it is not a problem to understand your code.
It will be nice also to provide with the demo the creation of an XML file using the different functions you have.
In the past I used the CMarkup[^], but I could not remove stuff on-the-fly from XML files, so I moved to .dan.g.[^] XmlFile from ToDoList[^]TodoList, but now, I'm happy to start using your code, although my knowledge with COM/DCOM is not strong enough yet..
Have a nice day.
-- Ricky Marek (AKA: rbid)
-- "Things are only impossible until they are not" --- Jean-Luc Picard
My articles
|
|
|
|
|
Hi, thanks for the module - it's a pretty one.
I've rewritten it a bit: changed CString to CStdString, so the module can be used without MFC, and changed char to TCHAR so it is now both ANSI and UNICODE compliant.
Want it as it is now?
|
|
|
|
|
Sorry, here is the xml file
<root> <participant>TEST
<envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
<notifications xmlns="http://markets.midwestiso.org/dart/xml">
<dispatch interval="2005-10-17T22:30:00.000-05:00" location="CIN.DPLG.BECK6">
<dispatchmw>84
<price>25.54
<dispatch interval="2005-10-17T22:30:00.000-05:00" location="CIN.DPLG.EBEN2">
<dispatchmw>124
<price>25.43
<dispatch interval="2005-10-17T22:30:00.000-05:00" location="CIN.DPLG.MIAF7">
<dispatchmw>141
<price>25.47
<dispatch interval="2005-10-17T22:30:00.000-05:00" location="CIN.DPLG.MIAF8">
<dispatchmw>272
<price>25.81
<dispatch interval="2005-10-17T22:30:00.000-05:00" location="CIN.DPLG.ZIMM">
<dispatchmw>272
<price>25.81
Dave G
|
|
|
|
|
I am new to XML and would appreciate some help getting started using the XMLNodeWrapper. My XML document looks like this:
//*********************************************************************************************
-
- <root>
<participant>TEST
- <envelope xmlns="http://schemas.xmlsoap.org/soap/envelope/">
-
- <notifications xmlns="http://markets.midwestiso.org/dart/xml">
- <dispatch interval="2005-10-17T22:30:00.000-05:00" location="SIN.APLG.HECK8">
<dispatchmw>84
<price>25.54
- <dispatch interval="2005-10-17T22:30:00.000-05:00" location="SIN.APLG.JBEN4">
<dispatchmw>124
<price>25.43
- <dispatch interval="2005-10-17T22:30:00.000-05:00" location="SIN.APLG.KIAF2">
<dispatchmw>141
<price>25.47
- <dispatch interval="2005-10-17T22:30:00.000-05:00" location="SIN.APLG.KIAF8">
<dispatchmw>272
<price>25.81
- <dispatch interval="2005-10-17T22:30:00.000-05:00" location="SIN.APLG.MIMM">
<dispatchmw>272
<price>25.81
//*********************************************************************************************
I have tried the following commands to retrieve the DispatchMW values but the szValue comes back NULL everytime. I really would like to retrieve each DispatchMW value per each location and store these values in a database. Any help would be appreciated.
//************************************************************
m_xmlDocument.Load("C:\\harris\\XML\\dispatch test.xml");
CXmlNodeWrapper root(m_xmlDocument.AsNode());
CXmlNodeWrapper myOutPutNode(root.FindNode("Dispatch/DispatchMW"));
CString szValue = myOutPutNode.GetText();
//************************************************************
Thanks in advance,
Dave G
|
|
|
|
|
Hello,
I need to create a new document, add nodes to it and save it.
How do I do it ?
How do I create a new node ?
How do I create a documnet from scratch?
Thanks,
jr.
|
|
|
|
|
Example:
CXmlDocumentWrapper doc;
doc.LoadXML("<root>");
CXmlNodeWrapper root(doc.AsNode());
CXmlNodeWrapper node(root.AddNode("New_Node"));
node.SetValue("SomeValue","Data_Item");
doc.Save("C:\\newdoc.xml");
Creative minds - create creative creations!
|
|
|
|
|
Hi
I'm also having problems creating a new XML document and saving it to file. The above code fails to compile, as AddNode is not a member of CXmlNodeWrapper? Also, doc.AsNode() returns NULL - is this to be expected?
Another example would be great, and would help to support this excellent XML wrapper class
|
|
|
|
|
I'm sorry for misleading you , since I was writing the above code from my memory , without actually looking at the source, and apparently my memory is not as good as I hoped it to be .
You should use "InsertNode" instead of "AddNode" (you can use -1 as an index to insert at the end).
Also the LoadXML function should load some actual XML string and not an empty string like it looks (the foeum engine must have stripped the XML tags away) , for example:
xmlDoc.LoadXML("<Root></Root>");
|
|
|
|