• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

xml prolog

 
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
author
Posts: 154
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try including this line near the top of your XSL stylesheet...
<xsl:output method="html">
David

[This message has been edited by David Peterson (edited November 29, 2001).]
 
Zhining Zhang
Greenhorn
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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"/>
...
=========================
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!