473,386 Members | 1,752 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.

how to locate where an xslt stylesheet failed

Dear experts,

After converting some .net code from using XslTransform to
XslCompiledTransform, one of my XSLs no longer runs. it fails with:

Attribute and namespace nodes cannot be added to the parent element after a
text, comment, pi, or sub-element node has already been added.

trouble is my stylesheet is long and complicated and I don't know where the
error was. is there any way of finding out which line number in the XSLT
produced the error? I tried it on Xml spy (which does tell you where the
error was) but the same transform doesn't fail in xml spy.

Andy
May 23 '07 #1
2 4461
Andy Fish wrote:
After converting some .net code from using XslTransform to
XslCompiledTransform, one of my XSLs no longer runs. it fails with:

Attribute and namespace nodes cannot be added to the parent element after a
text, comment, pi, or sub-element node has already been added.

trouble is my stylesheet is long and complicated and I don't know where the
error was. is there any way of finding out which line number in the XSLT
produced the error?
XsltException
<http://msdn2.microsoft.com/en-us/library/system.xml.xsl.xsltexception.aspx>
has properties LineNumber and LinePosition so assuming you get such an
exception your code should be able to catch it and output those properties.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
May 23 '07 #2
On 23 May, 17:45, Martin Honnen <mahotr...@yahoo.dewrote:
Andy Fish wrote:
After converting some .net code from using XslTransform to
XslCompiledTransform, one of my XSLs no longer runs. it fails with:
Attribute and namespace nodes cannot be added to the parent element after a
text, comment, pi, or sub-element node has already been added.
trouble is my stylesheet is long and complicated and I don't know where the
error was. is there any way of finding out which line number in the XSLT
produced the error?

XsltException
<http://msdn2.microsoft.com/en-us/library/system.xml.xsl.xsltexception...>
has properties LineNumber and LinePosition so assuming you get such an
exception your code should be able to catch it and output those properties.
--

Martin Honnen --- MVP XML
http://JavaScript.FAQTs.com/
Thanks Martin,

I caught the exception but unfortunately these 2 values are both 0 (I
suspect if they weren't they would have appeared in the message).
Still, at least the error message itself is good so it will give me
somewhere to start
May 24 '07 #3

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

Similar topics

6
by: Pete | last post by:
I am just getting to grips with XML and I was wondering if you could help me with something that no-one seems able or willing to help with.. I have an XSLT file which should be transforming a...
1
by: Mohit | last post by:
Hi Friends I have to call 1 of the 2 child XSLT files from the Main XSLT file based on some criteria. I want one child XSLT file will be executed by version 1 of XSLT processor and the other by...
0
by: JEDI_BC | last post by:
hi, I try hardly to use javascript functions in my XSL (exslt.org) using DOM/XSL (libxslt). It works on sablotron but it is too slow and cost too much cpu. I am up to date on my software...
12
by: gipsy boy | last post by:
Hello, I have sort of a big problem. I would really appreciate any help you could give me. I made a web service in C++ that throws XML to the client (browser). But, the XSLT transormation...
0
by: Jay Allard | last post by:
Hello I posted this in the vb.net group on the 2/25/2004, but didn't get any response. Here's attempt 2. Does anyone know of a more appropriate place to post this? One new piece of...
14
by: David Blickstein | last post by:
I have some XML documents that I want to open in a web browser and be automatically translated to HTML via XSLT. I'm using an xml-stylesheet processing command in a file called "girml.xml". ...
4
by: Moogy | last post by:
I'm pulling my hair out here. First, I'm new to XML, so that doesn't help, but none of this makes any sense to me. All I'm trying to do is take a simple source XML file and translate it with an...
7
by: One Handed Man \( OHM - Terry Burns \) | last post by:
I've been battling with this stupid problem for hours now. WebApp: Trying to do a simple transformation using XSLT to a Web Page, but it just failes without an error message ( In other words,...
6
by: Neal | last post by:
Hi All, I wrote a TOC treeview using xml and xslt, with help from this forum and MSDN help(thanks) Great in IE 6. (expect IE 5 as well, articles were circa 2000) However, Mozilla FireFox...
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: 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:
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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.