473,320 Members | 1,820 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

XML transform via XLS

Hi folks!

I want to transform a XML document using a XLS stylesheet
(transformNodeToObject()). I did my code as the MSDN examples suggest, the
transformation succeeds S_OK. Unfortunately, the XML result doc is not
valid, e.g. get_xml() fails, the string is empty.
Does that sound familiar to anyone? If yes, thanks for your help!

Richard
Jul 20 '05 #1
6 5540

"Richard Koch" <ri**********@aon.at> wrote in message
news:40***********************@newsreader01.highwa y.telekom.at...
Hi folks!

I want to transform a XML document using a XLS stylesheet
(transformNodeToObject()). I did my code as the MSDN examples suggest, the
transformation succeeds S_OK. Unfortunately, the XML result doc is not
valid, e.g. get_xml() fails, the string is empty.
Does that sound familiar to anyone? If yes, thanks for your help!


You may pass any stream object to contain the result -- e.g. the Response
object (in ASP) or ADODB.Stream
Cheers,

Dimitre Novatchev [XML MVP],
FXSL developer, XML Insider,

http://fxsl.sourceforge.net/ -- the home of FXSL
Resume: http://fxsl.sf.net/DNovatchev/Resume/Res.html
Jul 20 '05 #2
Sorry, but I do not know what you mean...

"Dimitre Novatchev" <dn********@yahoo.com> wrote in message
news:bv************@ID-152440.news.uni-berlin.de...

"Richard Koch" <ri**********@aon.at> wrote in message
news:40***********************@newsreader01.highwa y.telekom.at...
Hi folks!

I want to transform a XML document using a XLS stylesheet
(transformNodeToObject()). I did my code as the MSDN examples suggest, the transformation succeeds S_OK. Unfortunately, the XML result doc is not
valid, e.g. get_xml() fails, the string is empty.
Does that sound familiar to anyone? If yes, thanks for your help!


You may pass any stream object to contain the result -- e.g. the Response
object (in ASP) or ADODB.Stream
Cheers,

Dimitre Novatchev [XML MVP],
FXSL developer, XML Insider,

http://fxsl.sourceforge.net/ -- the home of FXSL
Resume: http://fxsl.sf.net/DNovatchev/Resume/Res.html

Jul 20 '05 #3

"Richard Koch" <ri**********@aon.at> wrote in message
news:40***********************@newsreader01.highwa y.telekom.at...
Sorry, but I do not know what you mean...


Read your MSXML4 SDK Documentation. Here's how the second argument to the
method is described:

"outputObject
An object. On return, contains the product of the transformation of this XML
document based on the XSLT style sheet. If the variant represents the
DOMDocument object, the document is built according to its properties and
its child nodes are replaced during this transformation process. The XML
transformation can also be sent to a stream. "

mk:@MSITStore:C:\Program%20Files\MSXML%204.0\doc\x mlsdk.chm::/htm/xml_mth_sz
_2jp0.htm
Note the last sentence. This is what you need. If the result tree does not
represent a well-formed xml document (e.g. has more than one top element),
the outputObject cannot be a XMLDOMDocument object. But it still can be any
stream object (one that supports the IStream interface) and the stream
object will process (e.g. write to a file) it.

This is a FAQ -- see for example:

http://sources.redhat.com/ml/xsl-lis.../msg01310.html
Cheers,

Dimitre Novatchev [XML MVP],
FXSL developer, XML Insider,

http://fxsl.sourceforge.net/ -- the home of FXSL
Resume: http://fxsl.sf.net/DNovatchev/Resume/Res.html

Jul 20 '05 #4
Richard Koch wrote:
Hi folks!

I want to transform a XML document using a XLS stylesheet
(transformNodeToObject()). I did my code as the MSDN examples suggest, the
transformation succeeds S_OK. Unfortunately, the XML result doc is not
valid, e.g. get_xml() fails, the string is empty.
Does that sound familiar to anyone? If yes, thanks for your help!


The output of an XSLT is not necesarily wellformed XML, for instance
when you're using the "text" or "html" output method. Note that XSLT
defaults to the "html" output method when the document element produced
is "html" (either lowercase or uppercase).

So if you need XML, specify "xsl:output method='xml'".

Julian
Jul 20 '05 #5
In article <bv************@ID-205037.news.uni-berlin.de>,
Julian Reschke <ju************@gmx.de> wrote:

% So if you need XML, specify "xsl:output method='xml'".

Keeping in mind that this doesn't guarantee that your XSL will
generate well-formed XML. For that, you need to define the transformation
correctly.
--

Patrick TJ McPhee
East York Canada
pt**@interlog.com
Jul 20 '05 #6

"Patrick TJ McPhee" <pt**@interlog.com> wrote in message
news:bv**********@news.eusc.inter.net...
In article <bv************@ID-205037.news.uni-berlin.de>,
Julian Reschke <ju************@gmx.de> wrote:

% So if you need XML, specify "xsl:output method='xml'".

Keeping in mind that this doesn't guarantee that your XSL will
generate well-formed XML. For that, you need to define the transformation
correctly.


Yes, the example I gave -- more than one top element, or no top element at
all (just one text node -- such results can be produced using "xsl:output
method='xml'".
Cheers,

Dimitre Novatchev [XML MVP],
FXSL developer, XML Insider,

http://fxsl.sourceforge.net/ -- the home of FXSL
Resume: http://fxsl.sf.net/DNovatchev/Resume/Res.html
Jul 20 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Alex Vinokur | last post by:
Functor-parameters in the for_each() and transform() algorithms are passed by value. Might it make sense to have also algorithms for_each2() and transform2() which pass Functor-parameters by...
0
by: Xiaolei Li | last post by:
first off, i'm a total newbie at this stuff so excuse any wrong usage of terminology or whatever else. i have a XSL to transform a Document such that all "text" nodes will have a "SPAN" inserted...
2
by: John Lehmann | last post by:
I have an interesting problem. I am performing an XSL transform using the System.Xml.Xsl.Transform class. I have a database that contains the XSL style sheet string. And it seems to work pretty...
9
by: Patrick Guio | last post by:
Dear all, I am trying to use the std::transform algorithm to to the following vector< vector<char> >::iterator ik = keys.begin(); // key list iterator vector< vector<char> >::iterator is = ik;...
6
by: Stephen Cook | last post by:
Having worked through the problems around enabling the document function using an XmlUrlResolver I started work on building a useful class to hide the intricacies. Trying to generalise the process...
3
by: Jason S | last post by:
Hello Group, I am just about tearing my hair out with this one and thought someone may have some insight. I have a transform that wasn't working so I grabbed the nearest debugger (xselerator)...
4
by: schneider | last post by:
Anyone know if there is a way to dynamicly create a Xslt template/s and use them as an xml transform with-out use files for the Xslt? All the methods I see use files. I want to create a Xslt...
1
by: Mike Hofer | last post by:
I've got two statements in my code that are both generating weird, weird, weird messages: The first one was, Dim document As System.Xml.XmlDocument Dim navigator As...
4
by: Dean Card | last post by:
Okay, so here is the situation. I have need to do some on-the-fly image creation. I have everything working great except for the last part of it, applying a perspective type transform to the...
6
by: Vijai Kalyan | last post by:
Hello, I am trying to use std::transform to take in a collection of strings, transform them and insert the result into an output container. So, I wrote something like this: std::wstring...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.