By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
429,326 Members | 2,726 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 429,326 IT Pros & Developers. It's quick & easy.

Problem with document()

P: n/a
Lis
Hi,

I have inconsistent behavior of document() function which I hope someone can
explain.

I have Windows Service (runs as LocalSystem) that perform some Xslt
transformation. In the stylesheet I load another Xml document using
document("http://localhost/myfile.xml") syntax. I use XmlUriResolver object
with credentials set to DefaultCredentials and pass it to the Transform
method.
Everything works fine on my workstation (WinXP x64, Framework 1.1, IIS 6).

Now, I have a production server which is Win 2000, IIS5. The same service
works here using domain account with all nessesary right but
document("http://localhost/myfile.xml") now doesn't work. No exception is
thrown from the application. No calls has been made to to IIS to the
http://localhost/myfile.xml (no records in the IIS log).

Any idea why it doesn't work?

Michael
Mar 23 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
To begin with, IIS5 and IIS6 should not matter in this case, since IIS6 is
by far more restrictive than IIS5 and if you were having any issues that
were web server related, you'd see it using IIS6.

My first question is: Are you using XslTransform or XslCompiledTransform?

Regardless, but especially if you are using XslCompiledTransform, you may
find reading this online migration document very useful! There are some
subtlties to using the XslCompiledTransform class with XsltSettings object,
which governs whether document() function is allowed.
http://blogs.msdn.com/xmlteam/articl...Transform.aspx

There are sections dedicated to the document() function and you will also
find some pertinet information on using XmlUrlResolver in the "Loading
Stylesheets and Source Documents" section.
"Lis" <Li*@discussions.microsoft.com> wrote in message
news:68**********************************@microsof t.com...
Hi,

I have inconsistent behavior of document() function which I hope someone
can
explain.

I have Windows Service (runs as LocalSystem) that perform some Xslt
transformation. In the stylesheet I load another Xml document using
document("http://localhost/myfile.xml") syntax. I use XmlUriResolver
object
with credentials set to DefaultCredentials and pass it to the Transform
method.
Everything works fine on my workstation (WinXP x64, Framework 1.1, IIS 6).

Now, I have a production server which is Win 2000, IIS5. The same service
works here using domain account with all nessesary right but
document("http://localhost/myfile.xml") now doesn't work. No exception is
thrown from the application. No calls has been made to to IIS to the
http://localhost/myfile.xml (no records in the IIS log).

Any idea why it doesn't work?

Michael

Mar 23 '06 #2

P: n/a
Lis
Thanks Alex.

I use XslTransform. XslCompiledTransform is not availble in FW v 1.1

Also my problem is that same code works in one environment and doesn't in
another.

Regards,
Michael

"Alex Krawarik[MSFT]" wrote:
To begin with, IIS5 and IIS6 should not matter in this case, since IIS6 is
by far more restrictive than IIS5 and if you were having any issues that
were web server related, you'd see it using IIS6.

My first question is: Are you using XslTransform or XslCompiledTransform?

Regardless, but especially if you are using XslCompiledTransform, you may
find reading this online migration document very useful! There are some
subtlties to using the XslCompiledTransform class with XsltSettings object,
which governs whether document() function is allowed.
http://blogs.msdn.com/xmlteam/articl...Transform.aspx

There are sections dedicated to the document() function and you will also
find some pertinet information on using XmlUrlResolver in the "Loading
Stylesheets and Source Documents" section.
"Lis" <Li*@discussions.microsoft.com> wrote in message
news:68**********************************@microsof t.com...
Hi,

I have inconsistent behavior of document() function which I hope someone
can
explain.

I have Windows Service (runs as LocalSystem) that perform some Xslt
transformation. In the stylesheet I load another Xml document using
document("http://localhost/myfile.xml") syntax. I use XmlUriResolver
object
with credentials set to DefaultCredentials and pass it to the Transform
method.
Everything works fine on my workstation (WinXP x64, Framework 1.1, IIS 6).

Now, I have a production server which is Win 2000, IIS5. The same service
works here using domain account with all nessesary right but
document("http://localhost/myfile.xml") now doesn't work. No exception is
thrown from the application. No calls has been made to to IIS to the
http://localhost/myfile.xml (no records in the IIS log).

Any idea why it doesn't work?

Michael


Mar 23 '06 #3

P: n/a
OK. With that in mind the very next thing I would try is to run your repro
on your machine under the domain user that you are running it as on the
production server rather than LocalSystem.

"Lis" <Li*@discussions.microsoft.com> wrote in message
news:FE**********************************@microsof t.com...
Thanks Alex.

I use XslTransform. XslCompiledTransform is not availble in FW v 1.1

Also my problem is that same code works in one environment and doesn't in
another.

Regards,
Michael

"Alex Krawarik[MSFT]" wrote:
To begin with, IIS5 and IIS6 should not matter in this case, since IIS6
is
by far more restrictive than IIS5 and if you were having any issues that
were web server related, you'd see it using IIS6.

My first question is: Are you using XslTransform or XslCompiledTransform?

Regardless, but especially if you are using XslCompiledTransform, you may
find reading this online migration document very useful! There are some
subtlties to using the XslCompiledTransform class with XsltSettings
object,
which governs whether document() function is allowed.
http://blogs.msdn.com/xmlteam/articl...Transform.aspx

There are sections dedicated to the document() function and you will also
find some pertinet information on using XmlUrlResolver in the "Loading
Stylesheets and Source Documents" section.
"Lis" <Li*@discussions.microsoft.com> wrote in message
news:68**********************************@microsof t.com...
> Hi,
>
> I have inconsistent behavior of document() function which I hope
> someone
> can
> explain.
>
> I have Windows Service (runs as LocalSystem) that perform some Xslt
> transformation. In the stylesheet I load another Xml document using
> document("http://localhost/myfile.xml") syntax. I use XmlUriResolver
> object
> with credentials set to DefaultCredentials and pass it to the Transform
> method.
> Everything works fine on my workstation (WinXP x64, Framework 1.1, IIS
> 6).
>
> Now, I have a production server which is Win 2000, IIS5. The same
> service
> works here using domain account with all nessesary right but
> document("http://localhost/myfile.xml") now doesn't work. No exception
> is
> thrown from the application. No calls has been made to to IIS to the
> http://localhost/myfile.xml (no records in the IIS log).
>
> Any idea why it doesn't work?
>
> Michael
>
>


Mar 24 '06 #4

P: n/a
Lis
Hi Alex,

I did this, and result stayed the same. My workstation works, production
server doesn't. However there is something I can't replicate localy:
stylesheet is located on the Linux file server which is acceessed via SAMBA,
the external document is on the localhost. As I mentioned before, there is no
records in the IIS log which I guess means it is not a permission issues. It
looks like that document() dssn't get called at all.

I plan to test one extra thing on Monday: I'll create custom resolver and
put trace inside GetEntity. But I have a bad feeling that I'll never get that
trace.

Is three anything else I can do to trace what is going on inside Transform?

Regards,
Michael

"Alex Krawarik[MSFT]" wrote:
OK. With that in mind the very next thing I would try is to run your repro
on your machine under the domain user that you are running it as on the
production server rather than LocalSystem.

"Lis" <Li*@discussions.microsoft.com> wrote in message
news:FE**********************************@microsof t.com...
Thanks Alex.

I use XslTransform. XslCompiledTransform is not availble in FW v 1.1

Also my problem is that same code works in one environment and doesn't in
another.

Regards,
Michael

"Alex Krawarik[MSFT]" wrote:
To begin with, IIS5 and IIS6 should not matter in this case, since IIS6
is
by far more restrictive than IIS5 and if you were having any issues that
were web server related, you'd see it using IIS6.

My first question is: Are you using XslTransform or XslCompiledTransform?

Regardless, but especially if you are using XslCompiledTransform, you may
find reading this online migration document very useful! There are some
subtlties to using the XslCompiledTransform class with XsltSettings
object,
which governs whether document() function is allowed.
http://blogs.msdn.com/xmlteam/articl...Transform.aspx

There are sections dedicated to the document() function and you will also
find some pertinet information on using XmlUrlResolver in the "Loading
Stylesheets and Source Documents" section.
"Lis" <Li*@discussions.microsoft.com> wrote in message
news:68**********************************@microsof t.com...
> Hi,
>
> I have inconsistent behavior of document() function which I hope
> someone
> can
> explain.
>
> I have Windows Service (runs as LocalSystem) that perform some Xslt
> transformation. In the stylesheet I load another Xml document using
> document("http://localhost/myfile.xml") syntax. I use XmlUriResolver
> object
> with credentials set to DefaultCredentials and pass it to the Transform
> method.
> Everything works fine on my workstation (WinXP x64, Framework 1.1, IIS
> 6).
>
> Now, I have a production server which is Win 2000, IIS5. The same
> service
> works here using domain account with all nessesary right but
> document("http://localhost/myfile.xml") now doesn't work. No exception
> is
> thrown from the application. No calls has been made to to IIS to the
> http://localhost/myfile.xml (no records in the IIS log).
>
> Any idea why it doesn't work?
>
> Michael
>
>


Mar 26 '06 #5

P: n/a
Hi, I already read your other post from Sunday where you got your answer,
glad to hear it worked out. But as for

"Is three anything else I can do to trace what is going on inside
Transform?"

There is currently no verbose logging built into the transform classes that
you can hook, no.

"Lis" <Li*@discussions.microsoft.com> wrote in message
news:BD**********************************@microsof t.com...
Hi Alex,

I did this, and result stayed the same. My workstation works, production
server doesn't. However there is something I can't replicate localy:
stylesheet is located on the Linux file server which is acceessed via
SAMBA,
the external document is on the localhost. As I mentioned before, there is
no
records in the IIS log which I guess means it is not a permission issues.
It
looks like that document() dssn't get called at all.

I plan to test one extra thing on Monday: I'll create custom resolver and
put trace inside GetEntity. But I have a bad feeling that I'll never get
that
trace.

Is three anything else I can do to trace what is going on inside
Transform?

Regards,
Michael

"Alex Krawarik[MSFT]" wrote:
OK. With that in mind the very next thing I would try is to run your
repro
on your machine under the domain user that you are running it as on the
production server rather than LocalSystem.

"Lis" <Li*@discussions.microsoft.com> wrote in message
news:FE**********************************@microsof t.com...
> Thanks Alex.
>
> I use XslTransform. XslCompiledTransform is not availble in FW v 1.1
>
> Also my problem is that same code works in one environment and doesn't
> in
> another.
>
> Regards,
> Michael
>
> "Alex Krawarik[MSFT]" wrote:
>
>> To begin with, IIS5 and IIS6 should not matter in this case, since
>> IIS6
>> is
>> by far more restrictive than IIS5 and if you were having any issues
>> that
>> were web server related, you'd see it using IIS6.
>>
>> My first question is: Are you using XslTransform or
>> XslCompiledTransform?
>>
>> Regardless, but especially if you are using XslCompiledTransform, you
>> may
>> find reading this online migration document very useful! There are
>> some
>> subtlties to using the XslCompiledTransform class with XsltSettings
>> object,
>> which governs whether document() function is allowed.
>> http://blogs.msdn.com/xmlteam/articl...Transform.aspx
>>
>> There are sections dedicated to the document() function and you will
>> also
>> find some pertinet information on using XmlUrlResolver in the "Loading
>> Stylesheets and Source Documents" section.
>>
>>
>> "Lis" <Li*@discussions.microsoft.com> wrote in message
>> news:68**********************************@microsof t.com...
>> > Hi,
>> >
>> > I have inconsistent behavior of document() function which I hope
>> > someone
>> > can
>> > explain.
>> >
>> > I have Windows Service (runs as LocalSystem) that perform some Xslt
>> > transformation. In the stylesheet I load another Xml document using
>> > document("http://localhost/myfile.xml") syntax. I use XmlUriResolver
>> > object
>> > with credentials set to DefaultCredentials and pass it to the
>> > Transform
>> > method.
>> > Everything works fine on my workstation (WinXP x64, Framework 1.1,
>> > IIS
>> > 6).
>> >
>> > Now, I have a production server which is Win 2000, IIS5. The same
>> > service
>> > works here using domain account with all nessesary right but
>> > document("http://localhost/myfile.xml") now doesn't work. No
>> > exception
>> > is
>> > thrown from the application. No calls has been made to to IIS to the
>> > http://localhost/myfile.xml (no records in the IIS log).
>> >
>> > Any idea why it doesn't work?
>> >
>> > Michael
>> >
>> >
>>
>>
>>


Mar 29 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.