• 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
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Unmarshaller, problem with create and use of instance of class

 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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();
 
author and iconoclast
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 24207
46
Mac OS X Eclipse IDE Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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


 
If you open the box, you will find Heisenberg strangling Shrodenger's cat. And waving this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic