473,386 Members | 1,766 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,386 software developers and data experts.

Resolver not working when transforming

I'd like to see if someone found a natural explanation to this. I have
this method for transforming docs:

/**
* Transforms an XmlDocument object with an XSL file, and returns
* another XmlDocument object. If something bad happens, null is
* returned instead.
*/
private XmlDocument Transform (string xml, string xsl)
{
try
{
XmlDocument xmlDocIn = new XmlDocument();
xmlDocIn.Load(xml);
XslTransform transformer = new XslTransform();
transformer.Load(xsl);
XmlDocument xmlDocOut = new XmlDocument();
xmlDocOut.Load(transformer.Transform(xmlDocIn, null, new
XmlUrlResolver()));
return xmlDocOut;
}
catch
{
return null;
}
}

Some stylesheets are calling other documents, so I need the resolver to
work. And it works fine when I run this as a standalone app:

using System;
using System.Xml;
using System.Xml.XPath;
using System.Xml.Xsl;

namespace XslTest3
{
class Test
{
[STAThread]
static void Main(string[] args)
{
XmlDocument xmlDocResult = Transform(args[0], args[1]);
xmlDocResult.Save(args[2]);
}

private static XmlDocument Transform (string xml, string xsl)
{
try
{
XmlDocument xmlDocIn = new XmlDocument();
xmlDocIn.Load(xml);
XslTransform transformer = new XslTransform();
transformer.Load(xsl);
XmlDocument xmlDocOut = new XmlDocument();
xmlDocOut.Load(transformer.Transform(xmlDocIn, null,
new XmlUrlResolver()));
return xmlDocOut;
}
catch
{
return null;
}
}
}
}

But when I paste *exactly* the same method (just removing "static") into
my main app, the resolver stops working! The transformation works, but
no data from the documents called from stylesheets come out.

Gustaf
Dec 4 '05 #1
0 1067

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

Similar topics

0
by: peter greaves | last post by:
hi everyone i am having a bad time with an entity resolver. my application uses a resolver to locally-cache the nested schemas that the basic xsd includes to a local directory. however i am...
0
by: Steinar Bang | last post by:
Platform: Intel PII, debian sarge testing/unstable, Blackdown J2SDK 1.4.0.99beta-1, ant 1.5.3-1, libxerces2-java 2.4.0-1, libxalan-java 2.4.1-1 Is there a way to make the Xerces-J parser, used as...
0
by: Soren Kuula | last post by:
Hi, I'm using a catalog for my Docbook xsl transformation. I can see (by having the resolver dump debug information) that the remapping of the system identifier <rewriteURI...
0
by: inetmug | last post by:
I have read that you can specify only the major/minor numbers (plus token and culture) to reference a DLL installed in the GAC, and that the resolver will "upselect" to the dll with the latest...
3
by: Pat Buxton | last post by:
I am transforming xml using XSLTransform which works fine. The xsl file is stored on eg. C:\temp1 and the xml is loaded from c:\temp2. All image files referenced in the stylesheet file are stored...
39
by: Frederick Gotham | last post by:
I have a general idea about how negative number systems work, but I'd appreciate some clarification if anyone would be willing to help me. Let's assume we're working with an 8-Bit signed integer,...
0
by: sumelong | last post by:
Hi all, i have an xsl with params to be parse using c#. I then used xslArgumentList and XpathNavigator Classes. I tried the following: 1-trans.transform(doc,params,writer,null). I had am empty...
0
by: giles.thomas | last post by:
We're proud to announce that today Resolver One, our flagship application, entered its public Beta phase. It can be downloaded from <http://www.resolversystems.com/download/(free registration...
0
by: giles.thomas | last post by:
We are proud to announce the release of Resolver One, version 1.2 - the largest IronPython application in the world, we think, at 38,000 lines of production code backed up by 150,000 lines of unit...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.