• Post Reply Bookmark Topic Watch Topic
  • New Topic

Unmarshaller, problem with create and use of instance of class  RSS feed

 
Paul dearrt
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How I create object of this class and use it on document? I was searchin on the internet but nothing.. thanks my piece of code...

class:
http://www.jopendocument.org/docs/org/jopendocument/io/SaxContentUnmarshaller.html#SaxContentUnmarshaller(org.jopendocument.model.OpenDocument)

code, how use SaxStylesUnmarshaller to ODT document?

File s = new File(cestaSouboru);
ODPackage p = new ODPackage(s);
SaxStylesUnmarshaller sax = new SaxStylesUnmarshaller();
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Welcome to JavaRanch!

Well, that class takes an OpenDocument as a constructor argument, and OpenDocument, in turn, has a public constructor that takes a File. So in theory,



Now, whether this makes any sense to do, I can't tell you -- the documentation for this library seems very weak, and I don't know if these classes are intended to be used this way.
 
Paul dearrt
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ernest Friedman-Hill wrote:Hi,

Welcome to JavaRanch!

Well, that class takes an OpenDocument as a constructor argument, and OpenDocument, in turn, has a public constructor that takes a File. So in theory,



Now, whether this makes any sense to do, I can't tell you -- the documentation for this library seems very weak, and I don't know if these classes are intended to be used this way.


Im afraid, that it doesn work, i couldnt give Opendocument as a parameter to SaxStyleUnmarshellers constructor
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, my friend, the very constructor you link to in your first post is the one that takes an OpenDocument as a constructor argument. It is a public class, and it's a public constructor. Altogether, this suggests that what I propose is not only entirely possible, but absolutely doable. If something's going wrong, it's possible that

1) You don't have this library available to the compiler (i.e., not on class path)
2) You're using a different version of the library than the one documented there
3) You've got other classes with the same names, and the compiler is importing the wrong ones
4) Something else is wrong.

In any case, if you were to share your actual compiler error messages, I am sure we could get you back on the right path.
 
Paul dearrt
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ernest Friedman-Hill wrote:Well, my friend, the very constructor you link to in your first post is the one that takes an OpenDocument as a constructor argument. It is a public class, and it's a public constructor. Altogether, this suggests that what I propose is not only entirely possible, but absolutely doable. If something's going wrong, it's possible that

1) You don't have this library available to the compiler (i.e., not on class path)
2) You're using a different version of the library than the one documented there
3) You've got other classes with the same names, and the compiler is importing the wrong ones
4) Something else is wrong.

In any case, if you were to share your actual compiler error messages, I am sure we could get you back on the right path.


At first, thank you very much. For yout time, responses...
It seems I linked to wrong document... this is right:
http://www.jopendocument.org/docs/org/jopendocument/io/SaxStylesUnmarshaller.html


 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!