|
hi sir,
I have another xml which have 7000 properties.Underneath which have child and sub child element.I think datareader or something like this will not be helpful for searching.If you have any specific answer to solve my problem please reply me.
wating for reply.
snehasish.
|
|
|
|
|
I second led mike. You'll get orders of magnitude better performance out of SQL Express. If you're irreversibly committed to XML, use an XML Reader, but you're just not going to get great performance out of it. Scalability is another issue - assuming you've got XML files, you'll constantly be getting conflicts as two users try to open the same file.
Since you're already using XML, I suggest looking into SQL server support for it (i.e. the XML data type). I've never used it in any serious way, but you can at least take a whack at getting the best of both worlds.
|
|
|
|
|
Hi,
Thanks for your reply.I think you have understood me.I am trying to develop according with your advise.If you get any other reply me.
|
|
|
|
|
Hi,
I have created service in which I am fetching data from database write that in xmldocument and returning XMLDOCUMENT.
But it raised error in client page
"System.Xml.XmlDocument" can not serialized.
is anybody have any solution.
Thanks,
Nagraj
|
|
|
|
|
|
How does one get to execute an Excel document using an XSLT
as well as a dataset inorder to generate the Excel Document?.
|
|
|
|
|
Kagiso Gladwell wrote: How does one get to execute an Excel document using an XSLT
As far as I know, you can't. Nothing executes an Excel document that I am aware of. Microsoft Excel can load and Excel document. Maybe you should try that. I don't know what any of this has to do with XML or XSLT.
led mike
|
|
|
|
|
Hello everybody,
Where does the RSS Feed Downloader feeds in local client system? Please share your knowledge if you have any idea.
Either you love IT or leave IT...
|
|
|
|
|
|
SNI wrote: During these fews days there are some updates (XP updates) OR some group policies has been changed in my company.
I would like to know is this have any impact on SOAP communication in my application.
Why are you asking in here about an XP update or your companies group policies? WTF dude?
led mike
|
|
|
|
|
I have tried an XPath successfully in both XML Spy, and SketchPath, but I cannot make it work in MSXML
The XPath without the name() function works fine in MSXML, but as soon as I try and use name() it fails.
I have setup a prefix using SelectionNamespaces, of find
I want to find the name of the first element attached to DesiredNode.
I originally tried name(//parent:node()/find:DesiredNode/node()) which failed,
I then tried //parent:node()/find:DesiredNode/node() , this however works fine
I have also tried alternate XPaths such as name(//find:DesiredNode/*), but this fails also.
All XML Spy XPath work (without the need for using the find prefix), and if I setup the alias of find correctly in SketchPath, I also always get the correct results.
What am I doing wrong?
|
|
|
|
|
|
Yes I am, I've also used the SelectionNamespaces property to setup a namespace alias. This works fine as long as I don't introduce name()
|
|
|
|
|
Post the following:
* MSXML version you are using
* Code setting SelectionLanguage
* Code setting SelectionNamespaces
* XPath statements that fail
* Smallest possible XML representing the problem.
led mike
|
|
|
|
|
> Post the following:
>
> * MSXML version you are using
Tried both 3 and 6
> * Smallest possible XML representing the problem.
<responseenv xmlns="http://example" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" schemaversion="3.0">
<header schemaversion="1.1">
<field1/>
</header>
<bodies>
<response>
<field1/>
</response>
</bodies>
</responseenv>
* Code setting SelectionLanguage
HRESULT hr = domDoc->setProperty(_bstr_t("SelectionLanguage"),_variant_t(_bstr_t("XPath")));
> * Code setting SelectionNamespaces
hr = domDoc->setProperty(_bstr_t("SelectionNamespaces"),_variant_t(_bstr_t("xmlns:find=\"http://example\"")));
> * XPath statements that fail
name(/find:ResponseEnv/find:Bodies/node())<br />
name(
* Code in Full
MSXML::IXMLDOMDocument2Ptr domDoc(__uuidof(MSXML2::DOMDocument60));
if ( domDoc->loadXML(sExample.c_str()) == VARIANT_TRUE)
{
HRESULT hr = domDoc->setProperty(_bstr_t("SelectionLanguage"),_variant_t(_bstr_t("XPath")));
if (FAILED(hr))
return 1;
hr = domDoc->setProperty(_bstr_t("SelectionNamespaces"),_variant_t(_bstr_t("xmlns:find=\"http://example\"")));
if (FAILED(hr))
return 1;
MSXML::IXMLDOMElementPtr pElem = NULL;
try
{
pElem = domDoc->selectSingleNode(_bstr_t("name(/find:ResponseEnv/find:Bodies/node())"));
}
catch (const _com_error &e)
{
MessageBox(NULL, static_cast<LPCTSTR>(e.Description()), e.ErrorMessage(), MB_OK);
}
} The original code was using an internal C+++ wrapper hiding the specifics of calling MSXML code, and was using raw_interfaces_only and so did not throw. The example above returns the error text "Expression must evaluate to a node-set", the original company code modified to throw a _com_error, returns a slightly different message "Expression does not return a DOM node.".
Peter
|
|
|
|
|
Stone Free wrote: name(/find:ResponseEnv/find:Bodies/node())
I have never seen name() used like that and I have no idea what this "find: " is nor can I find it referenced on www.w3schools.com. If that is newer XPath then of course it's not going to be supported in old DOMs like MSXML.
To output a node name I would have have an XSLT like
<for-each select="/Bodies">
<value-of select="name()"/>
</for-each> I don't know if you are using the XPath statement in XSLT or not but name() returns a string not a node which is why the error message says what it says. After seeing your XPath statements I don't have clue what you are trying to do.
led mike
|
|
|
|
|
Stone Free wrote: name(/find:ResponseEnv/find:Bodies/node())
led mike wrote: I have never seen name() used like that and I have no idea what this "find:" is nor can I find it referenced on www.w3schools.com. If that is newer XPath then of course it's not going to be supported in old DOMs like MSXML.
Mike,
find: won't be referenced at www.w3schools.com, because it is a namespace alias.
Take /ResponseEnv/Bodies/node() for example, this would work fine if my XML had been as follows:
<responseenv>
<header schemaversion="1.1">
<field1/>
</header>
<bodies>
<response>
<field1/>
</response>
</bodies>
</responseenv>
Unfortunately it has a namespace attached to it of http://example.
To make the XPath work successfully I had to use the SelectionNamespaces property. I could have made the alias anything. I could have written the following:
hr = domDoc->setProperty(_bstr_t("SelectionNamespaces"),_variant_t(_bstr_t("xmlns:codeproject=\"http://example\"")));
This would mean my XPath would have been /codeproject:ResponseEnv/codeproject:Bodies/node()
led mike wrote: I have never seen name() used like that
I got that syntax:
- name(): Returns the qualified name of the context node.
- name(node_set): Returns the qualified name of the first node in the given node set object.
From http://www.herongyang.com/xml/xpath_2.html[^]led mike wrote: I don't know if you are using the XPath statement in XSLT or not but name() returns a string not a node which is why the error message says what it says. After seeing your XPath statements I don't have clue what you are trying to do.
No the XPath statement is being used directly from the XML Document. The node identified with <response></response> will not actually be called response, but can be a number of different sub-messages and so I don't know in advance what it will be only that it will be the first node found that is a child of bodies
|
|
|
|
|
Stone Free wrote: No the XPath statement is being used directly from the XML Document.
Do you have any experience using a DOM with selectSingleNode ()? As far as I know you can't return the result of name() as a node because it's not a node. Therefore what you are trying to do below makes no sense to me.
pElem = domDoc->selectSingleNode(_bstr_t("name(/find:ResponseEnv/find:Bodies/node())"));
led mike
|
|
|
|
|
The XPath "name" function returns a string and not a node-set. Thus "pElem = domDoc->selectSingleNode(_bstr_t("name(/find:ResponseEnv/find:Bodies/node())")); " won't work.
I believe "IXMLDOMElement" has a "nodeName" property that returns what you are looking for.
"We make a living by what we get, we make a life by what we give." --Winston Churchill
|
|
|
|
|
Hi,
Im trying to send a XML string to a differet asp page and get the response from it.
'strFileName = an XML file with extension .txt
My Code sample
<pre>Set objXMLHTTP = Server.CreateObject("MSXML2.ServerXMLHTTP")
Set fsoFileSystem = createobject("scripting.filesystemobject")
set fsoFile = fsoFileSystem.OpenTextFile(strFileName,ForReading)
'Read the file into a variable
strACORDXML = fsoFile.ReadAll
fsoFile.Close
set fsoFile =Nothing
objXMLHTTP.open "POST", strURL, False
'Set the option to ignore SSL cert errors
'13056 is SXH_OPTION_IGNORE_SERVER_SSL_CERT_ERROR_FLAGS
objXMLHTTP.setOption 2, 13056
'Set the HTTP headers
objXMLHTTP.setRequestHeader "MIME-Version", "1.0"
objXMLHTTP.setRequestHeader "Content-Type", "Multipart/Related; boundary=MIME_boundary;"
'Send the XML string
objXMLHTTP.send (strACORDXML)
'Get the response
strResponse = objXMLHTTP.responseText </pre>
If I used MSXML2.ServerXMLHTTP object, it gives me time out error:
msxml3.dll error '80072ee2'
The operation timed out
Actually both webpages that's communicating are hosted at the same machine. The main site (ex. aa.domain.com) points to particular folder under it, while another one (ex. bb.domain.com) points to another folder which is two levels
up to the first one.
Please help!!
Bad Programmer
|
|
|
|
|
Bad Programmer wrote: The operation timed out
Oh sure, the XML timed out, right, good one.
led mike
|
|
|
|
|
hey, is there any solution for this. or idea to implement in a different way.
Thanks,
Bad Programmer
|
|
|
|
|
hi
Ples I need to know xml tags for some formats in word2007 like (heder ,titel and subtitel)
or how I can find them
I need it to work on the program for make some processes of word document
|
|
|
|
|
A Microsoft Word Document? Don't you think that Microsoft might document that information?
Good luck, you're going to need it.
led mike
|
|
|
|
|
what is the benefit of schema over DTD,and simple example to show the different if available?
|
|
|
|