Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / XML / March 2006

Tip: Looking for answers? Try searching our database.

Problem with document()

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lis - 23 Mar 2006 17:31 GMT
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] - 23 Mar 2006 17:52 GMT
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.

> Hi,
>
[quoted text clipped - 19 lines]
>
> Michael
Lis - 23 Mar 2006 18:13 GMT
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

> 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
[quoted text clipped - 35 lines]
> >
> > Michael
Alex Krawarik[MSFT] - 24 Mar 2006 20:09 GMT
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.

> Thanks Alex.
>
[quoted text clipped - 51 lines]
>> >
>> > Michael
Lis - 26 Mar 2006 23:44 GMT
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

> 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
[quoted text clipped - 55 lines]
> >> >
> >> > Michael
Alex Krawarik[MSFT] - 29 Mar 2006 18:08 GMT
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.

> Hi Alex,
>
[quoted text clipped - 89 lines]
>> >> >
>> >> > Michael

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.