Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 20th, 2010, 08:49 AM
Registered User
 
Join Date: Jun 2010
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default Issue with Tab Characters during XSLT Transformation

Hi,

Facing one weird issue during our XSLT processing. We are using XSLT in Oracle Service Bus, so not sure of the kind of XSLT processor/parser being used in this case.

Our case, XSLT is used to remove the namespaces from the input XML. For one of the XML structure, we are getting the following error.
javax.xml.transform.TransformerException:com.sun.o rg.apache.xml.internal.utils.WrappedRuntimeExcepti on:Content is not Allowed in Prolog


I verified that there are no extra contents in prolog. But the entire XML is tab indented. The following is the structure of the XML. When i remove one of the tab for <element1> XSLT is working fine as expected.

2tabs <RootElement>
2tabs <element1>
3tabs <element2>
and so on...3 tabs for all other elements.


Any insights into this issue? and How can we removed the tabs in the input xml using XSLT(1.0)?

Thanks & Regards
Siva
 
Old October 20th, 2010, 09:17 AM
mhkay's Avatar
Wrox Author
 
Join Date: Apr 2004
Posts: 4,962
Thanks: 0
Thanked 292 Times in 287 Posts
Default

The message "Content is not Allowed in Prolog" is a very common one produced by the SUN JDK XML parser: it basically means (as far as I can tell) that the file has been successfully opened, but the parser can't make head or tail of what it finds at the start of the file. This can be because there is whitespace before the XML declaration, or because of byte order marks, or because of encoding issues.

If the XML parser can't process the file, then you can't do anything about it using XSLT, because XSLT can only process stuff that makes it past the XML parser.
__________________
Michael Kay
http://www.saxonica.com/
Author, XSLT 2.0 and XPath 2.0 Programmer\'s Reference





Similar Threads
Thread Thread Starter Forum Replies Last Post
Accented characters transformation in XSL ROCXY XSLT 3 January 19th, 2006 08:50 AM
XSLT transformation yengzhai XSLT 1 April 21st, 2005 05:51 AM
newline and tab characters problem anshul Beginning PHP 1 December 2nd, 2004 06:58 AM
Getting tab characters to show up in output richard.york PHP How-To 9 November 21st, 2004 03:47 AM
XSLT transformation causes ^M reddygaru XSLT 2 December 16th, 2003 10:41 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.