Zhining Zhang

Greenhorn
+ Follow
since Jul 12, 2000
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Zhining Zhang

hello, all,
Which one is better for my next job? It is said that WebLogic has more customers in market. But I found there are more job opennings for WebSphere than for WebLogic.
Please give me some advices. thanks!
-Zhining Zhang
17 years ago

I guess that the xml file is a real xml file. When opening it, the server uses default template to render it.
Try to download, or 'save as', the xml file, you will get .html file ( note, .html extension). http://www.infoworld.com/articles/hn/xml/01/02/19/

this page uses print template with the same xml file.
http://staging.infoworld.com/articles/hn/xml/01/02/19/010219hncmovrvw.xml?Template=/storypages/printfriendly.html
It is interesting to me, because it is that xml files (data) use different templates, not templates use xml files.
Thanks!
-Zhining
hello,
very suprised.
open http://www.infoworld.com/articles/hn/xml/01/02/19/010219hncmcase.xml
I got a html file.
Is it a xml or html file? How did they implement it?
Thanks!
-Zhining Zhang

i got the answer.
transformer.setOutputProperty("method","html");
thanks anyway!
-Zhining Zhang

hello, all,
If xsl file does not have line
<xsl utput method="html"/>
can I set the output method for Transformer in java code?
thanks!
-Zhining Zhang

================================
<xsl:stylesheet version='1.0' xmlns:xsl='http://www.w3.org/1999/XSL/Transform' >
<xsl utput method="html"/>
=================================

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"/>
...
=========================
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
hello,
I have a html file like test.html
====================
<?xml version="1.0" encoding="UTF-8"?>
<H1>XSL</H1><H2>John Smith22</H2>
=====================
Using IE open the file, URL is d:\mytest\test.html. It looks fine.
But if URL is http://localhost:8080/testwebapp/test.html.
i got the error
===================
Only one top level element is allowed in an XML document. Line 2, Position 14

<H1>XSL</H1><H2>John Smith</H2>
=====================
Any idea?
Thanks!
-Zhining
17 years ago
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
hello,
I got an error in my servlet at the line of
TransformerFactory tFactory = TransformerFactory.newInstance();
I am using JBuilder, and Sun's jaxp.
The code works fine in regular class. The problem only occors in my servlet.
Thanks!
-Zhining Zhang

==============================
2001-08-28 09:47:47 - Ctx( /zzXmlXsl ): Exception in: R( /zzXmlXsl + /showme + null) - java.lang.SecurityException: sealing violation
at java.net.URLClassLoader.defineClass(URLClassLoader.java:234)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:120)
at javax.xml.transform.TransformerFactory.newInstance(TransformerFactory.java:117)
at zzxmlxsl.showme.transformXMLXSL(showme.java:93)
at zzxmlxsl.showme.doGet(showme.java:58)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
at org.apache.tomcat.core.Handler.service(Handler.java:286)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)
===============================
17 years ago
hello,
I got an error in my servlet at the line of
TransformerFactory tFactory = TransformerFactory.newInstance();
I am using JBuilder, and Sun's jaxp.
The code works fine in regular class. The problem only occors in my servlet.
Thanks!
-Zhining Zhang

==============================
2001-08-28 09:47:47 - Ctx( /zzXmlXsl ): Exception in: R( /zzXmlXsl + /showme + null) - java.lang.SecurityException: sealing violation
at java.net.URLClassLoader.defineClass(URLClassLoader.java:234)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
at java.lang.ClassLoader.defineClass0(Native Method)
at java.lang.ClassLoader.defineClass(ClassLoader.java:486)
at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:111)
at java.net.URLClassLoader.defineClass(URLClassLoader.java:248)
at java.net.URLClassLoader.access$100(URLClassLoader.java:56)
at java.net.URLClassLoader$1.run(URLClassLoader.java:195)
at java.security.AccessController.doPrivileged(Native Method)
at java.net.URLClassLoader.findClass(URLClassLoader.java:188)
at java.lang.ClassLoader.loadClass(ClassLoader.java:297)
at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:286)
at java.lang.ClassLoader.loadClass(ClassLoader.java:253)
at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:313)
at java.lang.Class.forName0(Native Method)
at java.lang.Class.forName(Class.java:120)
at javax.xml.transform.TransformerFactory.newInstance(TransformerFactory.java:117)
at zzxmlxsl.showme.transformXMLXSL(showme.java:93)
at zzxmlxsl.showme.doGet(showme.java:58)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:740)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:853)
at org.apache.tomcat.core.ServletWrapper.doService(ServletWrapper.java:404)
at org.apache.tomcat.core.Handler.service(Handler.java:286)
at org.apache.tomcat.core.ServletWrapper.service(ServletWrapper.java:372)
at org.apache.tomcat.core.ContextManager.internalService(ContextManager.java:797)
at org.apache.tomcat.core.ContextManager.service(ContextManager.java:743)
at org.apache.tomcat.service.http.HttpConnectionHandler.processConnection(HttpConnectionHandler.java:210)
at org.apache.tomcat.service.TcpWorkerThread.runIt(PoolTcpEndpoint.java:416)
at org.apache.tomcat.util.ThreadPool$ControlRunnable.run(ThreadPool.java:498)
at java.lang.Thread.run(Thread.java:484)
===============================

case 3 is correct too. the output is
str=zhining2
hello,
Could anyone explain the differents among the following 3 cases?
scope ???
thanks! -Zhining Zhang
case 1: ====================
<%!
String str = "zhining";
%>
<%
out.println( "str=" + str );
%>
case 2: ==========
<%
String str = "zhining";
out.println( "str=" + str );
%>
case 3: ===========
<%!
String str = "zhining";
%>
<%
String str = "zhining2";
out.println( "str=" + str );
%>
Alex,
Thanks so much! www.erudite-center.com/java seems a very good site.
-Zhining
19 years ago