HI java ranch, I am very upset , because i am not able to get the newInstance for this javax.xml.transform.TransformerFactory . Can any one plese help me to resolve this problem.Description About my Project:My project deals with xmls. Simply saying i need to xml file in java code by using the TransformerFactory. I am using tomcat Server. From the java documentation of TransformerFactory i come to know the terms called lib/jaxp.properties , and it's required to have the implementation class .Can any one tell me steps i need to follow:I am just using the the following code:
Thanks in advance
Makarand Parab
Ranch Hand
Joined: Dec 10, 2004
Posts: 121
posted
0
Hi Arul Try this way out TransformerFactory tansfact = TransformerFactory.newInstance(); Transformer transformer = tansfact.newTransformer(); Checkout if ur getting transformer as null before u move ahead from this point
Are you trying to work with XML and XSL.
Let me know
Regards Makarand Parab
arul jothi
Greenhorn
Joined: Jan 28, 2005
Posts: 5
posted
0
HI Makarand Parab , Thanks for ur reply. the TransformerFactory object is null. So i am not able to get the Transformer from this factory. About ur second question, i am just creating a Document object then i am trying to create a xml file. For this i need a Transformer instance.
Thanks once again. Waiting for ur reply.
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 32767
posted
0
Do you have a library that's capable of creating transformers in your classpath? That would be either Xalan (from Jakarta) or Saxon (on SourceForge). Those two also come with instructions on how set them up, that is to say, what you need to put into the jaxp.properties file.
this way u will get document object. Morever u need to have the parser jar file [one ur using xalan or xerces2] in the classpath. Transformer factory is mostly used when you are working with XML and XSL. For simple creation of document object to work with XML using dom u can use the above code.
Let me know
Regards Makarand Parab
Ulf Dittmer
Marshal
Joined: Mar 22, 2005
Posts: 32767
posted
0
Transformer factory is mostly used when you are working with XML and XSL.
Which is what the poster is doing. That is clear from the original post.
For simple creation of document object to work with XML using dom u can use the above code.
Which is what the poster is not doing. That also is clear from the original post. Your point is?