-3

I have a code in java and javascript to parse a XML and generate a html page. but the parser i'm using is in C. So i need to use those headers in java code. Is it possible?

since xerces parser i'm using is in C can i use the .hpp files imported into the Java code?

Thanks in advance!!!

reji
  • 5
  • 2
  • Wait, so you have Java/Javascript code that parses XML, but the parser is in C. So the parser is written in 3 languages? – awksp Jun 13 '14 at 06:12
  • 1
    You can write the parse logic in c and then invoke it by jni. – tianwei Jun 13 '14 at 06:15
  • 1
    You can use a native interface: http://stackoverflow.com/questions/4664899/wrapping-c-c-inside-java Java runs C under the hood, but of course, many of java's features under the hood are java-exclusive – Aarowaim Jun 13 '14 at 06:15
  • 2
    Java has XML parsers of its own. Heck, one's even [provided for you in the JDK](http://docs.oracle.com/javase/tutorial/jaxp/)! – yshavit Jun 13 '14 at 06:26
  • 2
    What is your __specific__ problem? Questioners here are expected to _at least some_ research on their own. – Sebastian Mach Jun 13 '14 at 07:36
  • Question is so confusing. Parser is written in 3 languages?? The parser well might be in Java as well. Please explain the question further. – Sameer Sawla Mar 10 '15 at 01:46

1 Answers1

0

no. you can's use.c headers will not accepted by java.but you can use JNA. You do have to declare anythng.it automatically generates Java wrappers. visit http://www.swig.org/Doc2.0/Java.html

Joe Sebin
  • 452
  • 4
  • 24