• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Rob Spoor
  • Henry Wong
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Carey Brown
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh
  • Jj Roberts

SAX Parser with Xalan

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I am using XML applications.
I am using Xalan parser for Xml file transformation.
job1 : Create XML document dynamically with data from
database.
job2 : Transform generated XML file with xsl to get
HTML file output.
job 1 is working fine with jaxp parser
job 2 is working fine with xalan parser
I am creating xml file dynamically by fetching data
from database.
When I am using Xalan parser class path setting I am
not able to generate XML document
But by adding jaxp parser in the classpath I am able
to generete the document. But now if I am tring to
transform it I am getting the runtime exception that
"Namespace not supported by the parser".
How can I get both of the functions working properly
with either of the parser.
Thanx in Advance,
Devang
 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You need to make sure the parser JAXP is SAX 2.0 and DOM 2.0 compliant. I had a similar problem not to long ago. I fixed it by making sure the "parser" (JAXP in your case) is first in the classpath. BTW I believe there is a parser already in the xalan/xerces packages and you shouldn't need JAXP. (I think it is already included in those packages) Hope this helps
 
Ranch Hand
Posts: 213
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When using JAXP, try turning on namespace-awareness using setNameSpaceAware(true) when you configure the JAXP factory, javax.xml.parsers.SAXParserFactory. The default is set to false when you use Sun's parser & factory-implementaion com.sun.xml.parser.SAXParserFactoryImpl.
Also if you use a different parser with JAXP, you may run into classpath problems if the parser supports more features than SAX 1.0 (JAXP parser only supports 1.0). In that case try adjusting the class-path as John suggested.
 
Ruth Stout was famous for gardening naked. Just like this tiny ad:
SKIP - a book about connecting industrious people with elderly land owners
https://coderanch.com/t/skip-book
reply
    Bookmark Topic Watch Topic
  • New Topic