|
Thanks!
Daniel
---------------------------
Never change a running system!
|
|
|
|
|
Hi Gurus,
I have a greate trouble while updating the value of text node. I have a
pointer to the node from existing XML document:
----------------------
IXMLDOMNodePtr pNode;
TCHAR szTmp[100];
VARIANT varTmp;
_stprintf(szTmp,"%d",newid);
varTmp.vt=VT_BSTR; varTmp.bstrVal=_bstr_t(szTmp);
hr=pNode->put_nodeTypedValue(varTmp); // hr returns E_FAIL under IE 5.x
----------------------
This works on systems with IE 6.0 installed.
This doesn't work on systems with IE 5.x installed.
Please help me! How to update the node on systems with IE 5.x installed ?
I'm a XML novice so any ideas appreciated.
Yours sincerely,
Alex Bash
|
|
|
|
|
Install MSXML version 3. It's available from the Microsoft site. As a bonus, it supports proper XSLT, whereas the standard did not exist when IE 5.x came out, so they had to make some guesses.....
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Correction: Install MSXML version 4.
Without installing and still running on those "IE5.x systems", I suggest assigning the value to nodeValue (instead of nodeTypedValue), and validate when parsing.
Where does your element get the type info from? Schemas, or DTD? What is the node's dataType value? I would assume both IE5.x and IE6.0 have a different opinion about the node's data type...
Bernd
|
|
|
|
|
While i using an interface of DOM (IXMLDOMNode *) as an parameter of an interface like that :
<br />
[helpstring("method Load")] HRESULT Load([in]IXMLDOMNode * piXMLNode);<br />
there is an midl error :
midl\oleaut32.dll : error MIDL2020 : error generating type library : AddImplType failed : IXMLDOMDocument
How it caused and how to handle it?
thank.
Scratch
|
|
|
|
|
You can only pass a limited number of parameters on a COM interface, and the only way to pass COM objects is as an IUnkown * ( and maybe IDispatch *, I forget ).
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Ok,that's it ,thanks.
Scratch
|
|
|
|
|
Christian Graus wrote:
You can only pass a limited number of parameters on a COM interface, and the only way to pass COM objects is as an IUnkown * ( and maybe IDispatch *, I forget ).
Actually, you can pass anything as long as the midl-compiler knows about it. I.e. anything declared within the same idl file or imported from another idl-file.
--
This space for rent.
|
|
|
|
|
If you are defining a custom interface or dual interfaces, gorget what Christian said to you: you CAN do it. The only problem will appear when you use a [in, out] parameter, and then, the only problem will be that scripting clients won't be able to call your method (you'll get a "type mismatch" from VBScript)
You need to put a importlib in your IDL file, under the library section:
For importing ADO, you could do this:
importlib("c:\program files\common files\system\ado\msado26.tlb");
change the path to the MSXML parser type library on your development machine;
PS:
As much as I hate VB, it can be a great tool for protoryping COM interfaces and quickly writing a IDL. When you don't know how to define a COM interface, create a COM DLL in VB with the desired interface and look the IDL on OLEVIEW
I see dumb people
|
|
|
|
|
Another question ...
When the midl process my .idl file ,it arbitrarily import the default msxml sdk and use the old version objects.
if use one of these directors
#include "C:\Program Files\MSXML 4.0\inc\msxml2.h"
#include "C:\Program Files\MSXML 4.0\inc\msxml2.idl"
#import "C:\winnt\system32\msxml4.dll" no_namespace
Certain Interfaces are redefine .
My wonder how to got rid of the midl's default msxml library and use my own sdk library?
Scratch
|
|
|
|
|
How to use xml with data is xml another(same include file in C language)
Ngo Hoai Phuong
|
|
|
|
|
If you're asking how to change the format of XML, the answer is XSL, you can build one XML document from another easily that way.
If that's not what you're asking, please reword it, because I don't understand.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
hello
i want to know how xml handles image,
here is a scenario
let say i have a word document(having an image inserted in it) and i want to change this document to xml, now how xml would save or handle this image, the whole image would b embeded or just a path of it or ?
Asim
|
|
|
|
|
Asim,
I think you must consider your requirements: is it required a single (Word) document must be represented by a *single* XML document? (in which case the answer is obvious).
Otherwise, I suggest referencing. After all, there is only a very small number of graphics formats that lend themselves to XML encoding in an acceptable way. Embedding a JPEG in XML doesn't sound very efficient to me.
Bernd
|
|
|
|
|
well, sir.
consider a word document in whcih a picture is inserted, now i want to change this document to xml, now what i was saying is that how the target, which is xml file would save this picture, like a href or ref in html or would save the whole picture in the form of pixels or whatever, this is what i want to know.
ASIM
Asim
|
|
|
|
|
Asim,
Next time I would have phrased the question differently. (How does word save an embedded picture in it's xml file.)
XML will save the file in what ever manner the app handles (assuming it is a valid file.) So it could save the picture on the side and insert a reference in the appropriate XML element. I would guess that word encodes the file (just like a server does sending it out over the internet) and sets an elements CData section with that encoded text string.
If you have word just do a sample doc with a small picture in it.
"I will find a new sig someday."
|
|
|
|
|
Hi Gurus!
I'm XML novice. Please, help me in a creating an attribute of a new node. I'm using VC++ 6.0. I want to get XML document as follows:
<Filter Id="1">
<Name>Some name</Name>
</Filter>
My problem is I can't create the attribute "Id" of <Filter> node. What should I do ? My code is:
VARIANT varNODEELEMENT;
varNODEELEMENT.vt=VT_I2; varNODEELEMENT.iVal=NODE_ELEMENT;
pNode=XmlDocPtr->createNode(varNODEELEMENT, L"Filter", L"");
if (pNode==NULL) return;
pNodeFilter=pNodeMain->appendChild(pNode);
pNodeTmp=XmlDocPtr->createNode(varNODEELEMENT, L"Name", L"");
if (pNodeTmp==NULL) return;
_bstr_t tmpbstr("Some name");
pNodeTmp->put_dataType(L"NODE_TEXT");
pNodeTmp->put_text(tmpbstr);
pNodeFilter->appendChild(pNodeTmp);
Yours sincerely,
Alex Bash
|
|
|
|
|
Does it need to be done this way ? Anyhow, I do know that an XmlAttribute is a seperate item which you can create and append to the Attributes collection of the node.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Hi All!
OK, here is architecture question:
My ultimate goal is: move "clent/server" application to web-site using XML/XSL. If user's browser is capable of processing XML/XSLT, processing should be performed on the cliend side, if not - on the server side.
That is a problem that I don't understand how to implement it:
1. I cannot let user access URL where it will be name like http://<something>/myform.xml for two reasons:
- I cannot process DB connection in that .xml file. Situation is: some users will access data using common DB name, some will access it using their very own DB name. As far as I understand, I cannot do that in .xml file, so I need some sort of .asp or jsp or something else.
- User's browser could be so old that it will not understand .xml extention. I don't know is it valid reason or not (I'm VERY new to web development).
2. So I need to let user access URL where it will be name like http://<something>/myform.asp or http://<something>/myform.jsp. That page will internally (depending on a user's browser) do one of this:
- either take my .xml page, process it with my .xsl page and send result .html to the user; OR
- take my .xml page and send it directly to user'sd browser. User's browser will see .xsl reference inside, automatically load that .xsl from my site,
and process both of them locally at client (I hope )
3. Now it is a problem. Suppose, user want to resort columns in the table (which he see on the screen). In case of old browser it is easy - link will "POST" form back to server, server will process .xml again and return .html to the user.
What if user uses new browser and I want it process it again locally? If user accessed URL http://<something>/myform.xml, than myform.xml would be sitting in cash on user's computer (together with .xsl), so I could call "load" method of XSLT locally in browser, so browser will not connect to server again.
But in my scenario user accesed http://<something>/myform.asp. If I will specify that name as parameter for "load" function, browser will go to server for new copy of the same data (which I'm trying to avoid). If I will specify http://<something>/myform.xml - such file does not exist locally, it exists with some other name (which I don't know).
So what could be a solution?
I'm sure it's obvious, I'm just overloaded with this new technic and cannot get it
Hope my description of a problem was clear .
SY-
Kosta.
|
|
|
|
|
Given that it looks like you do not have good control on the browser the client will be using, I would highly recommend only doing server side processing. I.E. keep it as you say easy with the POST. Even if you have some performance issue, Make it work right first with the extra database calls. Then you can take time to make it work better after you have some experience.
"I will find a new sig someday."
|
|
|
|
|
Hi Gurus!
I am a XML beginner. I am trying to create the xsl style sheet for the following XML document. I can't retrieve in XSL the value of attribute "Id" from the "Filter" node.
This XML and XSL must be viewed in the regular IE 5.0 without additional MSXML packs. Help me!
<?xml version="1.0" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="2.xsl"?>
<TrafficReport>
<Filter Id="1">
<Name>TCP</Name>
<Sent>21122</Sent>
<Recv>4523487</Recv>
</Filter>
<Filter Id="2">
<Name>TCP 8080</Name>
<Sent>154953</Sent>
<Recv>7199212</Recv>
</Filter>
</TrafficReport>
2.xsl:
<?xml version="1.0"?>
<xsl:template xmlns:xsl="uri:xsl">
<HTML><BODY>
<table cellspacing="0" cellpadding="5" border="1">
<xsl:for-each select="TrafficReport/Filter">
<tr>
<td STYLE="font-family:Arial; font-size:12">
------Here is my problem <xsl:attribute name="Id"><xsl:value-of select="@Id"/></xsl:attribute>
</td>
<td STYLE="font-family:Arial; font-size:12">
<xsl:value-of select="Name"/>
</td>
<td STYLE="font-family:Arial; font-size:12">
<xsl:value-of select="Sent"/>
</td>
<td STYLE="font-family:Arial; font-size:12">
<xsl:value-of select="Recv"/>
</td>
</tr>
</xsl:for-each>
</table>
</BODY>
</HTML>
</xsl:template>
Yours sincerely,
Alex Bash
|
|
|
|
|
I think this is closer to what you are looking for
You have spelled trafficeReport with and without a capital T. Not the same element.
the xsl:attribute -> Generates an attribute in the destination document. I do not think you were creating a new attribute but just using the value of what you have.
http://www.vbxml.com/xsl/XSLTRef.asp is a fairly good online reference.
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="/">
<HTML><body>
<table cellspacing="0" cellpadding="5" border="1">
<xsl:for-each select="trafficReport/Filter">
<tr>
<td STYLE="font-family:Arial; font-size:12">
<xsl:value-of select="@Id"/>
</td>
<td STYLE="font-family:Arial; font-size:12">
<xsl:value-of select="Name"/>
</td>
<td STYLE="font-family:Arial; font-size:12">
<xsl:value-of select="Sent"/>
</td>
<td STYLE="font-family:Arial; font-size:12">
<xsl:value-of select="Recv"/>
</td>
</tr>
</xsl:for-each>
</table>
</body>
</HTML>
</xsl:template>
</xsl:stylesheet>
<b><i>"I will find a new sig someday."</i></b>
|
|
|
|
|
Hi All!
Basically all my question is in title: how to apply XSLT to XML on the server in JSP or ASP without DOM?
I have data.xml file and style.xsl file. If user access my page (either JSP or ASP or doesn't matter) with browser that supports _full_ XML + XSLT, than I just send to user file data.xml, user's browser processes it, finds reference to style.xlt, retrieves it and process both to the end result. If user uses outdated browser (no XML/XSLT or old versions), I do the same on the server.
Example of such script on server side:
<%
dim xmlMenu
dim xslMenu
'Get the source XML
set xmlMenu = server.CreateObject("Msxml2.DOMDocument.4.0")
xmlMenu.async = false
xmlMenu.load server.MapPath("data.xml")
'Get the XSLT to transform the XML
set xslMenu = server.CreateObject("Msxml2.DOMDocument.4.0")
xslMenu.async = false
xslMenu.load server.MapPath("style.xsl")
'Transform the source XML using XSLT
Response.Write xmlMenu.transformNode(xslMenu)
set xmlMenu = nothing
set xslMenu = nothing
%>
I want to have exactly the same but without DOM, because it takes a lot of memory (well, I personally didn't notice that. The above script processed 8MB file with 16,000+ nodes in 25 sec on my development PC (256MB Ram, P4 1.4, Personal Web Server + MSXML) to table-like HTML. But people say 4MB file takes > 100MB of RAM and is slow. May be they mean "stress testing"?).
I cannot use anything except ASP or JSP - no COM, C++, ActiveX or other stuff. Not that _I_ don't want to, but that's an in-house rules (((((
Thanks a lot for answer!
SY-
Kosta.
|
|
|
|
|
You want to apply XSL to XML, without an XSL parser of any kind ? How, exactly ? I don't think it's possible unless you write your own, and if your management insists you do it this way, I suggest you look for another job, and use the word 'morons' liberally in your resignation letter.
I'm sorry, I don't see how it can be done.
Christian
No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
Hey, at least Logo had, at it's inception, a mechanical turtle. VB has always lacked even that... - Shog9 04-09-2002
Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002
|
|
|
|
|
Well, I could use MSXML.
In fact, posted ASP script uses MSXML (I corrected my original question by adding some performance test numbers). But, if I right understand (may be I'm wrong here? - I'm complete novice with XML and ASP ), that script creates DOM object by calling "CreateObject" method. And I've seen posts in this forum that DOM is slow and takes a lot of memory. I found out that SAXON might be solution, but again - I cannot use any 3rd party software
I try to rephrase queastion - is it any way to run XSLT processor withing ASP or JSP without using "CreateObject" method?
And by the way - they are not morons. They are US government . Well, may be they are after all Tssss.
|
|
|
|
|