File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes xml prolog Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "xml prolog" Watch "xml prolog" New topic
Author

xml prolog

Zhining Zhang
Greenhorn

Joined: Jul 12, 2000
Posts: 29
hello,
I got
==============
<?xml version="1.0" encoding="UTF-8"?>
<H1>XSL</H1><H2>John Smith22</H2>
==============
from
xml file
===============
<?xml version="1.0"?>
<xslTutorial >
<title>XSL</title>
<author>John Smith</author>
</xslTutorial>
==================
and xsl file
==================
<?xml version="1.0"?>
<xslTutorial >
<title>XSL</title>
<author>John Smith</author>
</xslTutorial>
==================
Where the xml prolog line come from?
Can I delete it?
I am using JAXP. thanks!
-Zhining Zhang
David Peterson
author
Ranch Hand

Joined: Oct 14, 2001
Posts: 154
Try including this line near the top of your XSL stylesheet...
<xslutput method="html">
David

[This message has been edited by David Peterson (edited November 29, 2001).]
Zhining Zhang
Greenhorn

Joined: Jul 12, 2000
Posts: 29
hello, David,
after add the line. I got error message like
======================
** Transformer Factory error
javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: java.lang.NullPointerException
javax.xml.transform.TransformerConfigurationException: javax.xml.transform.TransformerException: java.lang.NullPointerException
at org.apache.xalan.processor.TransformerFactoryImpl.newTemplates(TransformerFactoryImpl.java:815)
at org.apache.xalan.processor.TransformerFactoryImpl.newTransformer(TransformerFactoryImpl.java:635)
at zzxmlxsl.showme.transformXMLXSL(showme.java:100)

============================
-Zhining Zhang
Zhining Zhang
Greenhorn

Joined: Jul 12, 2000
Posts: 29

David, Thanks so much! It works now.
the xsl file likes
===========
<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' >
<xsl utput method="html"/>
...
=========================
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: xml prolog