|
thank you.it work now
|
|
|
|
|
Hi,
Please let me know how can i get the attribute name and value from an Xml node and even setattribute name and value....
|
|
|
|
|
Which library are you using to read the xml file ?
|
|
|
|
|
|
Use IXMLDOMNode::get_attributes to get a list of attributes of a node into a IXMLDOMNamedNodeMap object.
The use IXMLDOMNamedNodeMap::getNamedItem to get the attribute node.
Using the attribute node you can do IXMLDOMNode::get_nodeValue and IXMLDOMNode::put_nodeValue .
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
Hi,
Thanks for ur reply...but if i use IXMLDOMNamedNodeMap::getNamedItem i need to pass the name of the attribute but the requirement is i need to get the name of the attribute by passing index....i tried
MSXML::IXMLDOMNodePtr Node;
pAttributeMap->get_item(i, Node);
and when i use
BSTR bstr;
Node->get_text(&bstr);
im getting the value of the attribute but i need to get even name of the attribute ..pls let me know how to achieve the same...
|
|
|
|
|
Try get_nodeName or get_nodeValue instead of get_text.
«_Superman_»
I love work. It gives me something to do between weekends.
|
|
|
|
|
|
Hi,
Is there any standard way to merge xml files(like XPATH or XSL) instead of we parsing each Xml file check for the nodes and attributes and inserting the same if not present...
it is getting too difficult to parse each Xml file for nodes and attributes...
For example i have an A.xml
<Test>
<sample value="34" value1="56">
</sample>
<sample1 value="25">
</sample1>
</Test>
and B.xml
<Test>
<sample value="34">
</sample>
</Test>
i need to merge the above A.xml file to B.xml ie finally
B.xml should look like
<Test>
<sample value="34" value1="56">
</sample>
<sample1 value="25">
</sample1>
</Test>
im able to achieve to add nodes which are not present in the B.xml but i was unable to add the extra attributes which are present in A.xml to B.Xml ,im able to add whole node at a time along with attributes but not able to add the extra attributes.. (using MSXML)
ie im able to achieve B.xml as follows..
<Test>
<sample value="34">
</sample>
<sample1 value="25">
</sample1>
</Test>
Please help me regarding the same
modified on Monday, June 15, 2009 2:56 AM
|
|
|
|
|
p_1960 wrote: Is there any standard way to merge xml files
No, because the way the merge is done depends on the contents of the XML files you use, and how you want to join them.
p_1960 wrote: XSL
You could use XSL - you'd want to get to know the document function[^], which allows you to read any XML document in an XSL stylesheet. This[^] looks like a good explanation with samples.
Java, Basic, who cares - it's all a bunch of tree-hugging hippy cr*p
|
|
|
|
|
My code snippet is something like this one,
class Base1
{
public:
Base1()
{
cout<<"Base1()"<<endl;
}
virtual void method()
{
cout<<"Base1::method()"<<endl;
}
};
class Base2
{
public:
Base2()
{
cout<<"Base2()"<<endl;
}
virtual void method()
{
cout<<"Base2::method()"<<endl;
}
};
class Derived:public Base1, public Base2
{
public:
Derived()
{
cout<<"Derived()"<<endl;
}
void method()
{
cout<<"Derived::method()"<<endl;
}
};
int _tmain(int argc, _TCHAR* argv[])
{
// Derived *d = static_cast<Derived *>(new Base1); // works fine
// application crash at Base2::method call, even though Base2() constructor is invoked
Derived *d = static_cast<Derived *>(new Base2);
d->method();
return 0;
}
With Base1, application works fine. But when I try to use Base2, application crashes at method() call.
And if I change the sequence in Derived class declaration to...
class Derived:public Base2, public Base1
then Base2 object works perfectly but Base1 crashes.
So, my question is why up-casting (or down-casting, not sure about specific word) works only with primary base class and not with secondary base classes??
|
|
|
|
|
Try reinterpret_cast insted of static_cast.
I dont know the reason why it is so. I will look it in details and update this post later.
The secret of life is not enjoyment
but education through experience.
- Swami Vivekananda.
|
|
|
|
|
|
Thanks, the article is really good.
|
|
|
|
|
how to implement text search logic in my application.
|
|
|
|
|
Please elaborate question what exactly you want?
I think This Link[^] may give you some guideline.
The secret of life is not enjoyment
but education through experience.
- Swami Vivekananda.
|
|
|
|
|
i want to implement text search..it can be of all document or from current page only..up or down the document..like find dialog in standard applications.
|
|
|
|
|
ali kanju wrote: i want to implement text search..it can be of all document or from current page only..up or down the document..like find dialog in standard applications.
You still didn't provide any useful information. You are talking about pages and document, what are you talking about exactly ? How is your data stored ? Is this a big string, a list of strings, ... ?
You also have to separate the problem in two distinct jobs: your program should first search for the matches (without showing that to the user), and then the information has to be displayed to the user.
Both aspects really depends on which datatype you are working with, how you display the information to the user, ...
So, if you want some useful help, you will need to provide a lot more of useful information.
|
|
|
|
|
can you please elaborate your requirement?
You need to google first, if you have "It's urgent please" mentioned in your question.
_AnShUmAn_
|
|
|
|
|
|
There's a surplus of vagueness here. Unfortunately, all I can offer is the shotgun approach. See strstr() , strchr() , CString::Find() , and string::find() .
"Old age is like a bank account. You withdraw later in life what you have deposited along the way." - Unknown
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
|
|
|
|
|
Hi all,
i m creating my application with any other name,now i want to change my exe name.
Please tell me how can i change it and after changing the name whenever i build the solution its build with new name not from old name.
please tell me how can i do this.
thanks in advance.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Hi,
You can change it from project properties.
please see Project Properties -> Linker -> outputfile
Change value for 'outputfile'. You will get desired outputfilename exe.
Hope this will help you.
The secret of life is not enjoyment
but education through experience.
- Swami Vivekananda.
|
|
|
|
|
Thanks.
To accomplish great things, we must not only act, but also dream;
not only plan, but also believe.
|
|
|
|
|
Hi,
Can anybody please help me to read a video stream from an IP address assigned to Avtech 4 channel MPEG4 DVR.
The DVR is connected with 4 webcams.
DVR stores video stream in a raw format on connected Hard Disk Drive.
DVR is also connected to a ethernet switch and it throws video streams on assigned IP address on 80 port.
i want to read that video stream from DVR IP address and port 80 using C, C++, or MFC.
Thanks & Regards,
Kunal.
|
|
|
|