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

'' is an invalid QName

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
Nov 12 '05 #1
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
Nov 12 '05 #2

"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
Nov 12 '05 #3
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
Nov 12 '05 #4
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

Nov 12 '05 #5

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

Similar topics

4
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...
0
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: ...
0
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...
3
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 ...
5
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...
11
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...
9
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...
2
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: ###################################################################...
4
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 ============== ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
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...
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
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...
0
tracyyun
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...

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.