Groups | Blog | Home
all groups > dotnet xml > march 2006 >

dotnet xml : Problem with document()


Lis
3/23/2006 8:31:21 AM
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

Alex Krawarik[MSFT]
3/23/2006 8:52:04 AM
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/articles/Introducing_XslCompiledTransform.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.


[quoted text, click to view]

Lis
3/23/2006 9:13:28 AM
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

[quoted text, click to view]
Alex Krawarik[MSFT]
3/24/2006 11:09:44 AM
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.

[quoted text, click to view]

Lis
3/26/2006 2:44:17 PM
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

[quoted text, click to view]
Alex Krawarik[MSFT]
3/29/2006 9:08:13 AM
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.

[quoted text, click to view]

AddThis Social Bookmark Button