Help
I'm trying to perform a transform and I keep on getting '' is invalid QName.
The weird thing is, I can take the same code, stylesheet and XML, put into a
Console app and it works okay. I've tested the stylesheet in Stylus Studio
and tried using nxslt and both work fine.
Any ideas?
Glenn 4 2842
Glenn wrote: I'm trying to perform a transform and I keep on getting '' is invalid QName. The weird thing is, I can take the same code, stylesheet and XML, put into a Console app and it works okay. I've tested the stylesheet in Stylus Studio and tried using nxslt and both work fine.
Then it probably has something to do with the way you run the
transformation. Show us your code.
--
Oleg Tkachenko [XML MVP, MCAD] http://blog.tkachenko.com
"Oleg Tkachenko" <oleg@!no!spam!please!tkachenko.com> wrote in message
news:uo**************@TK2MSFTNGP14.phx.gbl... Glenn wrote:
I'm trying to perform a transform and I keep on getting '' is invalid
QName. The weird thing is, I can take the same code, stylesheet and XML, put
into a Console app and it works okay. I've tested the stylesheet in Stylus
Studio and tried using nxslt and both work fine.
Then it probably has something to do with the way you run the transformation. Show us your code.
-- Oleg Tkachenko [XML MVP, MCAD] http://blog.tkachenko.com
Oleg
Here it is
private void TransformResponse( string transformPath, XmlDocument document,
string outputPath )
{
if ( !File.Exists( transformPath ) )
{
throw new FileNotFoundException( "XSLT file could not be found",
transformPath );
}
XslTransform transform = new XslTransform();
XmlReader transformReader = new XmlTextReader( transformPath );
transform.Load( transformReader, null, null );
using ( FileStream stream = File.Open( outputPath, FileMode.Create,
FileAccess.Write, FileShare.Write ) )
{
transform.Transform( document, null, stream, null );
}
}
Cheers
Glenn
Glenn wrote: Here it is
private void TransformResponse( string transformPath, XmlDocument document, string outputPath ) { if ( !File.Exists( transformPath ) ) { throw new FileNotFoundException( "XSLT file could not be found", transformPath ); }
XslTransform transform = new XslTransform(); XmlReader transformReader = new XmlTextReader( transformPath ); transform.Load( transformReader, null, null ); using ( FileStream stream = File.Open( outputPath, FileMode.Create, FileAccess.Write, FileShare.Write ) ) { transform.Transform( document, null, stream, null ); } }
Looks ok, but beware those nulls disable resolving any external
resources, be it xsl:import/xsl:include or document() function call.
Anyway, show us some minimal XSLT stylesheet to reproduce the problem.
--
Oleg Tkachenko [XML MVP, MCAD] http://blog.tkachenko.com
Oleg
It was nothing more than my forgetfulness. Forgot to change the app.config
to point to the correct stylesheet.
Thanks for the help though
Glenn (embarrassed)
"Oleg Tkachenko [MVP]" <oleg@NO!SPAM!PLEASEtkachenko.com> wrote in message
news:eO**************@TK2MSFTNGP14.phx.gbl... Glenn wrote:
Here it is
private void TransformResponse( string transformPath, XmlDocument
document, string outputPath ) { if ( !File.Exists( transformPath ) ) { throw new FileNotFoundException( "XSLT file could not be found", transformPath ); }
XslTransform transform = new XslTransform(); XmlReader transformReader = new XmlTextReader( transformPath ); transform.Load( transformReader, null, null ); using ( FileStream stream = File.Open( outputPath, FileMode.Create, FileAccess.Write, FileShare.Write ) ) { transform.Transform( document, null, stream, null ); } }
Looks ok, but beware those nulls disable resolving any external resources, be it xsl:import/xsl:include or document() function call. Anyway, show us some minimal XSLT stylesheet to reproduce the problem.
-- Oleg Tkachenko [XML MVP, MCAD] http://blog.tkachenko.com This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Gerson Kurz |
last post by:
I stumbled across this (while using my homebrewn enum class):
class test:
pass
instance = test()
setattr(instance, "THIS :*2+~# IS OBVIOUSLY INVALID", 123)
I would've expected some kind of...
|
by: James Thornton |
last post by:
I'm running PG 7.2.3, and I am getting these notices when running
vacuum analzye:
spower=# vacuum analyze;
NOTICE: Rel sec_browser_properties: TID 935/15: OID IS INVALID.
TUPGONE 0.
NOTICE: ...
|
by: John L. Clark |
last post by:
Given a Property definition in RDFS, how can one determine the
corresponding QName? I believe an example will be very illustrative;
I will do my best to explain my confusion afterwards. Using the...
|
by: Stephan Brunner |
last post by:
Hi
I have created two flavors of an XSLT stylesheet to transform all attributes
of an XML document to elements:
They both work as expected with MSXML and XMLSPY but throw an exception
...
|
by: Nick Flandry |
last post by:
I'm running into an Invalid Cast Exception on an ASP.NET application that runs fine in my
development environment (Win2K server running IIS 5) and a test environment (also Win2K server
running IIS...
|
by: Nad |
last post by:
Hello,
I have a page with two link buttons. When I click on the first one I call
server.execute("target.aspx") to view target.aspx on the original page.
Then I click on the second link button...
|
by: MR |
last post by:
I get the following Exception "The data at the root level is invalid. Line
1, position 642" whenever I try to deserialize an incoming SOAP message. The
incoming message is formed well and its...
|
by: none |
last post by:
Hi,
I'm opening a popup window with JavaScript. It has a command button.
This is from the primary source (opener) window:
###################################################################...
|
by: robert |
last post by:
On a server the binary (red hat) installed python2.4 and also a
fresh compiled python2.5 spits "sem_post: Invalid argument".
What is this and how can this solved?
Robert
==============
...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
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...
|
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
|
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...
|
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...
|
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...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
| |