That's a strange problem, alright. I never went looking for this one
Transform. Then write the document to a memory stream. Then read the
Seems kinda round-about. If anyone has a better idea: please step up!
representative of my employer.
I do not answer questions on behalf of my employer. I'm just a
programmer helping programmers.
"badbetty" <bch@genie.co.uk> wrote in message
news:5d22dcdd.0502181211.6c09d750@posting.google.com...
> Martin Honnen <mahotrash@yahoo.de> wrote in message
> news:<#LcTykbFFHA.2824@tk2msftngp13.phx.gbl>...
>> badbetty wrote:
>>
>>
>> > How does one typecast the XMLREADER returned from the XSLTRANSFORM
>> > method 'transform' into XMLTEXTREADER, so it can be passed in to an
>> > XMLVALIDATINGREADER?
>> >
>> > I am getting an invalid cast.
>>
>> When I look at the API documentation then both allow an XmlReader so
>> simply use that, I am not sure where you need or want to cast:
>> <
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemxmlxslxsltransformclasstransformtopic6.asp>
>> <
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfSystemXmlXmlValidatingReaderClassctorTopic1.asp>
>>
>>
>> If you still have problems, show us the relevant code snippets so what
>> we can see what exactly you are trying to cast to what.
>
>
> Thank you for the reply.
> Excuse the dirty VB code/syntax/spelling (just to keep it brief and
> for example only)
>
> dim xpd as xpathdocument
> dim xr as xmlreader
> dim xvr as xmlvalidatingreader
> dim xsl as xsltransform
>
> xpd = new xpathdocument("http://bla bla")
>
> xsl = new xsltransform()
> xsl.load("http://bla bla bla")
>
> xr = xsl.transform(xpd, nothing)
>
> xvr = new xmlvalidatingreader(xr) << this fails !
>
>
> it seems that xmlvalidatingreader constructor expects xmlreader - but
> only as a xmltextreader (in the current dotnet implementation).
>
> so tried to typecast (i used all different ways - this is one) just as
> a check, even though it should not be required i agree :
>
> xvr = new xmlvalidatingreader(ctype(xr,xmltextreader)) << this
> fails too
>
>
> anyway, as i was wanting to validate the resultant transfored xml it
> looks like i can not do it at present. or have i missed a trick.
>
> thank you.