Re: [Simple-support] Object obj = node.getSource() ?
Brought to you by:
niallg
|
From: Niall G. <gal...@ya...> - 2013-01-11 11:36:48
|
What is a SOURCE LIST? node.getSource() will product the underlying object, if you are using a JDK 1.6 or above this will be StAX its only DOM by default for 1.5 if you do not have StAX on the classpath. You can force the provider to DOM if you like. To do this take a closer look at the HackJob test case.
Thanks,
Niall
--- On Fri, 11/1/13, Jaewoo Lee <dl...@gm...> wrote:
> From: Jaewoo Lee <dl...@gm...>
> Subject: [Simple-support] Object obj = node.getSource() ?
> To: sim...@li...
> Received: Friday, 11 January, 2013, 1:54 AM
> Hi, Niall.
> During using Converter,
> I wanna make a SOURCE LIST of
> InputNode
> So I am referencing
> "HackJobToGrabFloatingTextTest.java".
>
> It's my code that I
> imitate HackJobToGrabFloatingTextTest.
> import
> org.simpleframework.xml.convert.Converter;import
> org.simpleframework.xml.stream.InputNode;
> import
> org.simpleframework.xml.stream.OutputNode;import
> org.w3c.dom.Element;
> public class SXCMTSConverter implements
> Converter<SXCMTS>{
> @Override
> public SXCMTS
> read(InputNode node) throws Exception
> { Object obj =
> node.getSource(); Element
> element = (Element)obj;
> .....
> } .....}
> but Exception popped.
> java.lang.ClassCastException:
> com.sun.xml.internal.stream.events.StartElementEvent cannot
> be cast to org.w3c.dom.Element
>
> Is that code something wrong ? Or
> wrong version of library? If wrong version, could you let me
> know right version of that Library?Or How do I
> make a list of Source List of Input Node?
>
> Thanks for your help.
>
> -----Inline Attachment Follows-----
>
> ------------------------------------------------------------------------------
> Master HTML5, CSS3, ASP.NET, MVC, AJAX, Knockout.js, Web API
> and
> much more. Get web development skills now with LearnDevNow
> -
> 350+ hours of step-by-step video tutorials by Microsoft MVPs
> and experts.
> SALE $99.99 this month only -- learn more at:
> http://p.sf.net/sfu/learnmore_122812
> -----Inline Attachment Follows-----
>
> _______________________________________________
> Simple-support mailing list
> Sim...@li...
> https://lists.sourceforge.net/lists/listinfo/simple-support
>
|