[prev in list] [next in list] [prev in thread] [next in thread]
List: castor-dev
Subject: [castor-dev] org.xml.sax.SAXException: unable to create XMLClassDescriptor for class
From: "Stefan H Westlund" <d98-swe () javasoul ! net>
Date: 2003-06-28 17:51:01
[Download RAW message or body]
Hello!
I'm changing from JAXB to Castor so I'm quite new to this. I got an Exception during \
unmarshalling an XML inputstream. I generated the Java object from the primer.xsd by:
javac -cp $CLASSPATH org.exolab.castor.builder.SourceGenerator -i primer.xsd -package \
primer
And if I use -nodesc (in the path) I will get an org.xml.sax.SAXException: Illegal \
Text data found as child of: words value: "1" The thing is that I had used this \
primer.xsd with JAXB and the xjc generator command and I could unmarshall the stream \
without problem.
By the way... When compiling the generated Java sourcefiles I will get:
Note: Some input files use or override a deprecated API.
Note: Recompile with -deprecation for details.
This is because the org.xml.sax.DocumentHandler is deprecated. Is this correct?
Could someone tell me what I am doing wrong?
Best Regards/
Stefan H Westlund
--------------------------------------------------------------------------------------------------------------------
The Stack Trace:
org.xml.sax.SAXException: unable to create XMLClassDescriptor for class: primer.Root
at org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.java:980)
at org.apache.xerces.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:411)
at org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:778)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:823)
at org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(XMLDocumentScannerImpl.java:1028)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1610)
at org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:348)
at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:539)
at org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:595)
at org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)
at org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1125)
at org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:555)
at granska.MyFrame.getRoot(MyFrame.java:268)
at granska.MyFrame.access$2(MyFrame.java:131)
at granska.MyFrame$AnalyzeThread.run(MyFrame.java:333)
----------------------------------------------------------------------------------------------------
The Java Sourcecode:
try {
char[] chars = _text.toCharArray();
HttpURLConnection servletConnection = \
(HttpURLConnection)MyStatic.getServletURL( "analyze").openConnection(); \
servletConnection.setDoOutput( true); servletConnection.setDoInput( true);
servletConnection.setUseCaches( false);
servletConnection.setRequestMethod( "POST");
servletConnection.setRequestProperty( "Content-length", String.valueOf( \
chars.length)); servletConnection.connect();
OutputStreamWriter toServlet = new OutputStreamWriter( \
servletConnection.getOutputStream()); toServlet.write("text=");
toServlet.write( chars);
toServlet.flush();
toServlet.close();
InputSource source = new InputSource( servletConnection.getInputStream());
source.setEncoding( "UTF-8");
Unmarshaller unmarshaller = new Unmarshaller( Root.class);
unmarshaller.setIgnoreExtraElements( true);
unmarshaller.setValidation( false);
Root root = (Root)unmarshaller.unmarshal( source);
return root;
} catch( Exception e) {
e.printStackTrace();
}
----------------------------------------------------------------------------------------------------------
The XML Sample:
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes"?>
<Root><s ref="0"><words>1</words>
<text>test</text>
<contents><w no="0" tag="nn.neu.sin.ind.nom" lemma="test">test</w>
</contents>
<matchings><match begin="0" end="0">clbegin@clrecog</match>
<match begin="0" end="0" features="nn.neu.sin.def.nom">np_min@nprecog</match>
</matchings>
<analysis><clause><ph type="NPmin" pos="0">test</ph>
</clause>
</analysis>
<bio><row>test nn.neu.sin.ind.nom NPB CLB</row>
<row/>
</bio>
<models><model name="unit"><probcheck begin="1" end="-1" clause_from="0" \
clause_to="0"><note>slutord -1 är mindre än startord 1</note> </probcheck>
<errors_found><row_err>test nn.neu.sin.ind.nom ok</row_err>
<row_err/>
</errors_found>
<result>-11</result>
</model>
</models>
<final_result>-11</final_result>
</s>
<scrutinizer></scrutinizer>
<results><summary><method>unit</method>
<error_thresh>0.5</error_thresh>
<errors_known>0</errors_known>
<detected_errors>0</detected_errors>
<style_errors>0</style_errors>
<false_alarms>0</false_alarms>
<total_alarms>0</total_alarms>
<coverage>NaN</coverage>
<precision>NaN</precision>
</summary>
<alarm_details><spelling_errors><total cov="NaN">0</total>
<sem_gram_err cov="NaN">0</sem_gram_err>
<verb_err cov="NaN">0</verb_err>
<compound_err cov="NaN">0</compound_err>
<other cov="NaN">0</other>
</spelling_errors>
<word_err><total cov="NaN">0</total>
<missing cov="NaN">0</missing>
<order cov="NaN">0</order>
</word_err>
<misc><total cov="NaN">0</total>
<style cov="NaN">0</style>
<foreign cov="NaN">0</foreign>
<tok_sent cov="NaN">0</tok_sent>
<bad_tag cov="NaN">0</bad_tag>
<other cov="0">0</other>
</misc>
</alarm_details>
<rules><scrut_rules></scrut_rules>
<rules_used_per_category></rules_used_per_category>
<rules_not_used><rule>clbegin@clrecog</rule>
<rule>np_min@nprecog</rule>
</rules_not_used>
</rules>
</results>
<tags><tag no="0" name="nn.neu.sin.def.nom"/>
<tag no="1" name="nn.utr"/>
<tag no="2" name="hd.utr/neu.plu.ind"/>
<tag no="3" name="jj.pos.sms"/>
<tag no="4" name="dt.utr/neu.plu.def"/>
<tag no="5" name="hs.def"/>
<tag no="6" name="jj.kom.utr/neu.sin/plu.ind/def.nom"/>
<tag no="7" name="jj.pos.utr/neu.plu.ind/def.nom"/>
<tag no="8" name="dt.utr.sin.ind/def"/>
<tag no="9" name="dt.utr/neu.sin.def"/>
<tag no="10" name="nn.neu.plu.ind.gen"/>
<tag no="11" name="nn"/>
<tag no="12" name="nn.utr.plu.def.nom"/>
<tag no="13" name="jj.pos.neu.sin.ind/def.nom"/>
<tag no="14" name="nn.utr.sin.def.nom.dat"/>
<tag no="15" name="vb.imp.akt.aux"/>
<tag no="16" name="ps.utr.sin.def"/>
<tag no="17" name="jj.pos.utr/neu.plu.ind.nom"/>
<tag no="18" name="dt.utr/neu.plu.ind/def"/>
<tag no="19" name="nn.utr.sin.ind.nom.dat"/>
<tag no="20" name="hd.neu.sin.ind"/>
<tag no="21" name="vb.prt.sfo.kop"/>
<tag no="22" name="sen.que"/>
<tag no="23" name="dt.utr/neu.plu.ind"/>
<tag no="24" name="nn.neu"/>
<tag no="25" name="pn.neu.sin.ind.sub/obj"/>
<tag no="26" name="pn.utr/neu.plu.def.sub/obj"/>
<tag no="27" name="hp"/>
<tag no="28" name="ps.utr/neu.sin/plu.def"/>
<tag no="29" name="pn.utr/neu.plu.def.obj"/>
<tag no="30" name="vb.prt.akt.aux"/>
<tag no="31" name="nn.utr.sin.ind.nom"/>
<tag no="32" name="ro"/>
<tag no="33" name="nn.utr.plu.def.gen"/>
<tag no="34" name="nn.neu.plu.ind.nom"/>
<tag no="35" name="nn.neu.sin.def.gen"/>
<tag no="36" name="nn.sms"/>
<tag no="37" name="jj.suv.mas.sin.def.nom"/>
<tag no="38" name="jj.suv.utr/neu.sin/plu.def.nom"/>
<tag no="39" name="vb.prs.sfo"/>
<tag no="40" name="pm.nom"/>
<tag no="41" name="sen.hea"/>
<tag no="42" name="nn.utr.sin.def.nom.set"/>
<tag no="43" name="sn"/>
<tag no="44" name="ab.kom"/>
<tag no="45" name="pad"/>
<tag no="46" name="dt.utr/neu.sin.ind"/>
<tag no="47" name="vb.imp"/>
<tag no="48" name="pn.utr.sin.def.sub/obj"/>
<tag no="49" name="pn.utr.sin.def.obj"/>
<tag no="50" name="rg.utr/neu.plu.ind/def.nom"/>
<tag no="51" name="jj.pos.utr/neu.sin.def.nom"/>
<tag no="52" name="sen.exc"/>
<tag no="53" name="rg.utr.sin.ind.nom"/>
<tag no="54" name="vb.prs.akt"/>
<tag no="55" name="pm.gen"/>
<tag no="56" name="dt.utr.sin.ind"/>
<tag no="57" name="dt.utr/neu.sin/plu.ind"/>
<tag no="58" name="nn.utr.sms"/>
<tag no="59" name="vb.inf.akt.aux"/>
<tag no="60" name="pn.utr.sin.def.sub"/>
<tag no="61" name="kn"/>
<tag no="62" name="vb.prs.sfo.kop"/>
<tag no="63" name="vb.prs.akt.mod"/>
<tag no="64" name="vb.inf.akt.mod"/>
<tag no="65" name="pc.gen"/>
<tag no="66" name="ro.nom"/>
<tag no="67" name="jj.pos.neu.sin.ind.nom"/>
<tag no="68" name="nn.utr.plu.ind.nom"/>
<tag no="69" name="pn.utr.sin.ind.sub"/>
<tag no="70" name="jj.suv.utr/neu.plu.def.nom"/>
<tag no="71" name="dt.neu.sin.def"/>
<tag no="72" name="rg.sin"/>
<tag no="73" name="ro.sin"/>
<tag no="74" name="vb.imp.akt.kop"/>
<tag no="75" name="hd.utr.sin.ind"/>
<tag no="76" name="nn.neu.sin.def.nom.set"/>
<tag no="77" name="vb.kon.prs.akt"/>
<tag no="78" name="ab.suv"/>
<tag no="79" name="vb.inf.akt"/>
<tag no="80" name="jj.pos.utr.sin.ind.nom"/>
<tag no="81" name="nn.neu.plu.def.gen"/>
<tag no="82" name="vb.imp.akt.mod"/>
<tag no="83" name="vb.prt.akt.mod"/>
<tag no="84" name="dt.neu.sin.ind"/>
<tag no="85" name="pn.utr/neu.plu.ind.sub/obj"/>
<tag no="86" name="pn.neu.sin.def.sub/obj"/>
<tag no="87" name="vb.inf.akt.kop"/>
<tag no="88" name="rg.neu.sin.ind.nom"/>
<tag no="89" name="pn.mas.sin.def.sub/obj"/>
<tag no="90" name="ro.gen"/>
<tag no="91" name="nn.neu.plu.def.nom"/>
<tag no="92" name="dt.mas.sin.ind/def"/>
<tag no="93" name="dt.neu.sin.ind/def"/>
<tag no="94" name="vb.inf.sfo"/>
<tag no="95" name="jj.suv.utr/neu.sin/plu.ind.nom"/>
<tag no="96" name="rg.gen"/>
<tag no="97" name="hp.neu.sin.ind"/>
<tag no="98" name="vb.kon.prt"/>
<tag no="99" name="sen.per"/>
<tag no="100" name="ps.utr/neu.plu.def"/>
<tag no="101" name="nn.utr.sin.ind.nom.set"/>
<tag no="102" name="nn.utr.sin.def.nom"/>
<tag no="103" name="pn.utr.plu.def.sub"/>
<tag no="104" name="nn.neu.sin.ind.gen"/>
<tag no="105" name="ps.neu.sin.def"/>
<tag no="106" name="pn.utr.plu.def.obj"/>
<tag no="107" name="jj.pos.utr.sin.ind/def.nom"/>
<tag no="108" name="vb.prt.sfo"/>
<tag no="109" name="mad"/>
<tag no="110" name="ab"/>
<tag no="111" name="pn.utr/neu.sin/plu.def.obj"/>
<tag no="112" name="vb.sup.akt"/>
<tag no="113" name="mid"/>
<tag no="114" name="vb.sup.akt.kop"/>
<tag no="115" name="jj.pos.mas.sin.def.nom"/>
<tag no="116" name="hp.utr/neu.plu.ind"/>
<tag no="117" name="vb.sup.akt.mod"/>
<tag no="118" name="jj.kom.sms"/>
<tag no="119" name="nn.utr.sin.def.gen"/>
<tag no="120" name="rg.nom"/>
<tag no="121" name="nn.neu.sin.ind.nom"/>
<tag no="122" name="rg.yea"/>
<tag no="123" name="pl"/>
<tag no="124" name="in"/>
<tag no="125" name="vb.prt.akt"/>
<tag no="126" name="nn.neu.sms"/>
<tag no="127" name="vb.sup.sfo"/>
<tag no="128" name="nn.utr.plu.ind.gen"/>
<tag no="129" name="pn.utr.sin.ind.sub/obj"/>
<tag no="130" name="dt.utr.sin.def"/>
<tag no="131" name="nn.neu.sin.ind.nom.set"/>
<tag no="132" name="vb"/>
<tag no="133" name="pp"/>
<tag no="134" name="vb.prs.akt.kop"/>
<tag no="135" name="nn.utr.sin.ind.gen"/>
<tag no="136" name="jj.gen"/>
<tag no="137" name="vb.prt.akt.kop"/>
<tag no="138" name="ie"/>
<tag no="139" name="ro.mas.sin.ind/def.nom"/>
<tag no="140" name="jj.pos.utr/neu.sin/plu.ind/def.nom"/>
<tag no="141" name="hp.utr.sin.ind"/>
<tag no="142" name="pc.prs.utr/neu.sin/plu.ind/def.nom"/>
<tag no="143" name="sen.non"/>
<tag no="144" name="pn.utr/neu.plu.def.sub"/>
<tag no="145" name="ha"/>
<tag no="146" name="vb.prs.akt.aux"/>
<tag no="147" name="ab.pos"/>
<tag no="148" name="pm.sms"/>
</tags>
<rules><categories><category><name>nprecog</name>
<count>0</count>
</category>
<category><name>abrecog</name>
<count>0</count>
</category>
<category><name>qnrecog</name>
<count>0</count>
</category>
<category><name>acc</name>
<count>0</count>
</category>
<category><name>jjrecog</name>
<count>0</count>
</category>
<category><name>vbrecog</name>
<count>0</count>
</category>
<category><name>clrecog</name>
<info>CL</info>
<count>0</count>
</category>
<category><name>pprecog</name>
<count>0</count>
</category>
<category><name>prob</name>
<info>PROB</info>
<count>0</count>
</category>
</categories>
<rules_used></rules_used>
</rules>
</Root>
--------------------------------------------------------------------------------------------------
The primer.xsd file:
<?xml version="1.0" encoding="ISO-8859-1" standalone="yes" ?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:element name="Root">
<xs:complexType>
<xs:sequence>
<xs:element name="s" minOccurs="0" maxOccurs="unbounded">
<xs:complexType>
<xs:sequence>
<xs:element name="words" >
<xs:complexType>
<xs:sequence>
<xs:any />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="text" >
<xs:complexType>
<xs:sequence>
<xs:any />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="paragraph" minOccurs="0" >
<xs:complexType>
<xs:sequence>
<xs:any />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="contents" >
<xs:complexType>
<xs:sequence>
<xs:any />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="matchings" >
<xs:complexType minOccurs="0">
<xs:sequence>
<xs:any />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="analysis" >
<xs:complexType minOccurs="0">
<xs:sequence>
<xs:any />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="bio" minOccurs="0" >
<xs:complexType>
<xs:sequence>
<xs:element name="row" type="xs:string" minOccurs="0" maxOccurs="unbounded" \
/> </xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="models" >
<xs:complexType minOccurs="0">
<xs:sequence>
<xs:any />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="final_result" >
<xs:complexType minOccurs="0">
<xs:sequence>
<xs:any />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="sent_comm" minOccurs="0" >
<xs:complexType minOccurs="0">
<xs:sequence>
<xs:any />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
<xs:attribute name="ref" type="xs:integer" use="optional" />
</xs:complexType>
</xs:element>
<xs:element name="scrutinizer" minOccurs="0" >
<xs:complexType minOccurs="0">
<xs:sequence>
<xs:any />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="results" minOccurs="0" >
<xs:complexType minOccurs="0" >
<xs:sequence>
<xs:any />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="tags" minOccurs="0" >
<xs:complexType minOccurs="0" >
<xs:sequence>
<xs:any />
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="rules" minOccurs="0" >
<xs:complexType minOccurs="0" >
<xs:sequence>
<xs:any />
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
</xs:schema>
[Attachment #3 (text/html)]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.2800.1170" name=GENERATOR>
<STYLE></STYLE>
</HEAD>
<BODY bgColor=#ffffff>
<DIV><FONT face=Arial size=2>Hello!</FONT></DIV>
<DIV><FONT face=Arial size=2>I'm changing from JAXB to Castor so I'm
quite new to this. I got an Exception during unmarshalling an XML
inputstream.</FONT></DIV>
<DIV><FONT face=Arial size=2>I generated the Java object from the primer.xsd
by:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>javac -cp $CLASSPATH
org.exolab.castor.builder.SourceGenerator -i primer.xsd -package
primer</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>And if I use -nodesc (in the path) I will get an
org.xml.sax.SAXException: Illegal Text data found as child of: words value:
"1"<BR></FONT><FONT face=Arial size=2>The thing is that I had used this
primer.xsd with JAXB and the xjc generator command and I could unmarshall the
stream without problem.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>By the way... When compiling the generated Java
sourcefiles I will get:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Note: Some input files use or override a deprecated
API.</FONT></DIV>
<DIV><FONT face=Arial size=2>Note: Recompile with -deprecation for
details.</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>This is because the org.xml.sax.DocumentHandler is
deprecated. Is this correct?</FONT></DIV>
<DIV><FONT face=Arial size=2>Could someone tell me what I am doing
wrong?</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>Best Regards/</FONT></DIV>
<DIV><FONT face=Arial><FONT size=2>Stefan H Westlund</FONT></DIV></FONT>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial
size=2>--------------------------------------------------------------------------------------------------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>The Stack Trace:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>org.xml.sax.SAXException: unable to create
XMLClassDescriptor for class: primer.Root</FONT></DIV>
<DIV><FONT face=Arial size=2> at
org.exolab.castor.xml.UnmarshalHandler.startElement(UnmarshalHandler.java:980)</FONT></DIV>
<DIV><FONT face=Arial size=2> at
org.apache.xerces.parsers.AbstractSAXParser.startElement(AbstractSAXParser.java:411)</FONT></DIV>
<DIV><FONT face=Arial size=2> at
org.apache.xerces.impl.dtd.XMLDTDValidator.startElement(XMLDTDValidator.java:778)</FONT></DIV>
<DIV><FONT face=Arial size=2> at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanStartElement(XMLDocumentFragmentScannerImpl.java:823)</FONT></DIV>
<DIV><FONT face=Arial size=2> at
org.apache.xerces.impl.XMLDocumentScannerImpl$ContentDispatcher.scanRootElementHook(XMLDocumentScannerImpl.java:1028)</FONT></DIV>
<DIV><FONT face=Arial size=2> at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl$FragmentContentDispatcher.dispatch(XMLDocumentFragmentScannerImpl.java:1610)</FONT></DIV>
<DIV><FONT face=Arial size=2> at
org.apache.xerces.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:348)</FONT></DIV>
<DIV><FONT face=Arial size=2> at
org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:539)</FONT></DIV>
<DIV><FONT face=Arial size=2> at
org.apache.xerces.parsers.DTDConfiguration.parse(DTDConfiguration.java:595)</FONT></DIV>
<DIV><FONT face=Arial size=2> at
org.apache.xerces.parsers.XMLParser.parse(XMLParser.java:152)</FONT></DIV>
<DIV><FONT face=Arial size=2> at
org.apache.xerces.parsers.AbstractSAXParser.parse(AbstractSAXParser.java:1125)</FONT></DIV>
<DIV><FONT face=Arial size=2> at
org.exolab.castor.xml.Unmarshaller.unmarshal(Unmarshaller.java:555)</FONT></DIV>
<DIV><FONT face=Arial size=2> at
granska.MyFrame.getRoot(MyFrame.java:268)</FONT></DIV>
<DIV><FONT face=Arial size=2> at
granska.MyFrame.access$2(MyFrame.java:131)</FONT></DIV>
<DIV><FONT face=Arial size=2> at
granska.MyFrame$AnalyzeThread.run(MyFrame.java:333)<BR></FONT></DIV>
<DIV><FONT face=Arial
size=2>----------------------------------------------------------------------------------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>The Java Sourcecode:</FONT></DIV>
<DIV><FONT face=Arial size=2> </DIV></FONT>
<DIV><FONT face=Arial size=2> try
{<BR> char[] chars =
_text.toCharArray();<BR> HttpURLConnection
servletConnection = (HttpURLConnection)MyStatic.getServletURL(
"analyze").openConnection();<BR>
servletConnection.setDoOutput( true);<BR>
servletConnection.setDoInput( true);<BR>
servletConnection.setUseCaches( false);<BR>
servletConnection.setRequestMethod( "POST");<BR>
servletConnection.setRequestProperty( "Content-length", String.valueOf(
chars.length));<BR>
servletConnection.connect();<BR>
OutputStreamWriter toServlet = new OutputStreamWriter(
servletConnection.getOutputStream());<BR>
toServlet.write("text=");<BR> toServlet.write(
chars);<BR>
toServlet.flush();<BR>
toServlet.close();<BR> InputSource source = new
InputSource(
servletConnection.getInputStream());<BR>
source.setEncoding( "UTF-8");<BR> Unmarshaller
unmarshaller = new Unmarshaller( Root.class);<BR>
unmarshaller.setIgnoreExtraElements( true);<BR>
unmarshaller.setValidation( false);<BR> Root root
= (Root)unmarshaller.unmarshal( source);<BR>
return root;<BR> } catch( Exception e)
{<BR> e.printStackTrace();<BR>
}</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial
size=2>----------------------------------------------------------------------------------------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>The XML Sample:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><?xml version="1.0" encoding="ISO-8859-1"
standalone="yes"?><BR><Root><s
ref="0"><words>1</words><BR><text>test</text><BR><contents><w \
no="0" tag="nn.neu.sin.ind.nom"
lemma="test">test</w><BR></contents><BR><matchings><match
begin="0" end="0">clbegin@clrecog</match><BR><match begin="0"
end="0"
features="nn.neu.sin.def.nom">np_min@nprecog</match><BR></matchings><BR><analysis><clause><ph \
type="NPmin"
pos="0">test</ph><BR></clause><BR></analysis><BR><bio><r \
ow>test nn.neu.sin.ind.nom NPB CLB</row><BR><row/><BR></bio><BR><models><model \
name="unit"><probcheck begin="1" end="-1" clause_from="0"
clause_to="0"><note>slutord -1 är mindre än startord
1</note><BR></probcheck><BR><errors_found><row_err>test n \
n.neu.sin.ind.nom ok</row_err><BR><row_err/><BR></errors_found> \
<BR><result>-11</result><BR></model><BR></models><BR><final \
_result>-11</final_result><BR></s><BR><scrutinizer></scrutiniz \
er><BR><results><summary><method>unit</method><BR><error \
_thresh>0.5</error_thresh><BR><errors_known>0</errors_known><BR>& \
lt;detected_errors>0</detected_errors><BR><style_errors>0</style_err \
ors><BR><false_alarms>0</false_alarms><BR><total_alarms>0</tot \
al_alarms><BR><coverage>NaN</coverage><BR><precision>NaN</prec \
ision><BR></summary><BR><alarm_details><spelling_errors><total \
cov="NaN">0</total><BR><sem_gram_err
cov="NaN">0</sem_gram_err><BR><verb_err
cov="NaN">0</verb_err><BR><compound_err
cov="NaN">0</compound_err><BR><other
cov="NaN">0</other><BR></spelling_errors><BR><word_err><total \
cov="NaN">0</total><BR><missing
cov="NaN">0</missing><BR><order
cov="NaN">0</order><BR></word_err><BR><misc><total
cov="NaN">0</total><BR><style
cov="NaN">0</style><BR><foreign
cov="NaN">0</foreign><BR><tok_sent
cov="NaN">0</tok_sent><BR><bad_tag
cov="NaN">0</bad_tag><BR><other
cov="0">0</other><BR></misc><BR></alarm_details><BR><rules> \
<scrut_rules></scrut_rules><BR><rules_used_per_category></rules_u \
sed_per_category><BR><rules_not_used><rule>clbegin@clrecog</rule> \
<BR><rule>np_min@nprecog</rule><BR></rules_not_used><BR></rules><BR></results><BR><tags><tag \
no="0" name="nn.neu.sin.def.nom"/><BR><tag no="1"
name="nn.utr"/><BR><tag no="2" name="hd.utr/neu.plu.ind"/><BR><tag
no="3" name="jj.pos.sms"/><BR><tag no="4"
name="dt.utr/neu.plu.def"/><BR><tag no="5" name="hs.def"/><BR><tag
no="6" name="jj.kom.utr/neu.sin/plu.ind/def.nom"/><BR><tag no="7"
name="jj.pos.utr/neu.plu.ind/def.nom"/><BR><tag no="8"
name="dt.utr.sin.ind/def"/><BR><tag no="9"
name="dt.utr/neu.sin.def"/><BR><tag no="10"
name="nn.neu.plu.ind.gen"/><BR><tag no="11" name="nn"/><BR><tag
no="12" name="nn.utr.plu.def.nom"/><BR><tag no="13"
name="jj.pos.neu.sin.ind/def.nom"/><BR><tag no="14"
name="nn.utr.sin.def.nom.dat"/><BR><tag no="15"
name="vb.imp.akt.aux"/><BR><tag no="16"
name="ps.utr.sin.def"/><BR><tag no="17"
name="jj.pos.utr/neu.plu.ind.nom"/><BR><tag no="18"
name="dt.utr/neu.plu.ind/def"/><BR><tag no="19"
name="nn.utr.sin.ind.nom.dat"/><BR><tag no="20"
name="hd.neu.sin.ind"/><BR><tag no="21"
name="vb.prt.sfo.kop"/><BR><tag no="22" name="sen.que"/><BR><tag
no="23" name="dt.utr/neu.plu.ind"/><BR><tag no="24"
name="nn.neu"/><BR><tag no="25"
name="pn.neu.sin.ind.sub/obj"/><BR><tag no="26"
name="pn.utr/neu.plu.def.sub/obj"/><BR><tag no="27"
name="hp"/><BR><tag no="28" name="ps.utr/neu.sin/plu.def"/><BR><tag
no="29" name="pn.utr/neu.plu.def.obj"/><BR><tag no="30"
name="vb.prt.akt.aux"/><BR><tag no="31"
name="nn.utr.sin.ind.nom"/><BR><tag no="32" name="ro"/><BR><tag
no="33" name="nn.utr.plu.def.gen"/><BR><tag no="34"
name="nn.neu.plu.ind.nom"/><BR><tag no="35"
name="nn.neu.sin.def.gen"/><BR><tag no="36" name="nn.sms"/><BR><tag
no="37" name="jj.suv.mas.sin.def.nom"/><BR><tag no="38"
name="jj.suv.utr/neu.sin/plu.def.nom"/><BR><tag no="39"
name="vb.prs.sfo"/><BR><tag no="40" name="pm.nom"/><BR><tag no="41"
name="sen.hea"/><BR><tag no="42"
name="nn.utr.sin.def.nom.set"/><BR><tag no="43" name="sn"/><BR><tag
no="44" name="ab.kom"/><BR><tag no="45" name="pad"/><BR><tag no="46"
name="dt.utr/neu.sin.ind"/><BR><tag no="47" name="vb.imp"/><BR><tag
no="48" name="pn.utr.sin.def.sub/obj"/><BR><tag no="49"
name="pn.utr.sin.def.obj"/><BR><tag no="50"
name="rg.utr/neu.plu.ind/def.nom"/><BR><tag no="51"
name="jj.pos.utr/neu.sin.def.nom"/><BR><tag no="52"
name="sen.exc"/><BR><tag no="53" name="rg.utr.sin.ind.nom"/><BR><tag
no="54" name="vb.prs.akt"/><BR><tag no="55" name="pm.gen"/><BR><tag
no="56" name="dt.utr.sin.ind"/><BR><tag no="57"
name="dt.utr/neu.sin/plu.ind"/><BR><tag no="58"
name="nn.utr.sms"/><BR><tag no="59" name="vb.inf.akt.aux"/><BR><tag
no="60" name="pn.utr.sin.def.sub"/><BR><tag no="61"
name="kn"/><BR><tag no="62" name="vb.prs.sfo.kop"/><BR><tag no="63"
name="vb.prs.akt.mod"/><BR><tag no="64"
name="vb.inf.akt.mod"/><BR><tag no="65" name="pc.gen"/><BR><tag
no="66" name="ro.nom"/><BR><tag no="67"
name="jj.pos.neu.sin.ind.nom"/><BR><tag no="68"
name="nn.utr.plu.ind.nom"/><BR><tag no="69"
name="pn.utr.sin.ind.sub"/><BR><tag no="70"
name="jj.suv.utr/neu.plu.def.nom"/><BR><tag no="71"
name="dt.neu.sin.def"/><BR><tag no="72" name="rg.sin"/><BR><tag
no="73" name="ro.sin"/><BR><tag no="74"
name="vb.imp.akt.kop"/><BR><tag no="75"
name="hd.utr.sin.ind"/><BR><tag no="76"
name="nn.neu.sin.def.nom.set"/><BR><tag no="77"
name="vb.kon.prs.akt"/><BR><tag no="78" name="ab.suv"/><BR><tag
no="79" name="vb.inf.akt"/><BR><tag no="80"
name="jj.pos.utr.sin.ind.nom"/><BR><tag no="81"
name="nn.neu.plu.def.gen"/><BR><tag no="82"
name="vb.imp.akt.mod"/><BR><tag no="83"
name="vb.prt.akt.mod"/><BR><tag no="84"
name="dt.neu.sin.ind"/><BR><tag no="85"
name="pn.utr/neu.plu.ind.sub/obj"/><BR><tag no="86"
name="pn.neu.sin.def.sub/obj"/><BR><tag no="87"
name="vb.inf.akt.kop"/><BR><tag no="88"
name="rg.neu.sin.ind.nom"/><BR><tag no="89"
name="pn.mas.sin.def.sub/obj"/><BR><tag no="90"
name="ro.gen"/><BR><tag no="91" name="nn.neu.plu.def.nom"/><BR><tag
no="92" name="dt.mas.sin.ind/def"/><BR><tag no="93"
name="dt.neu.sin.ind/def"/><BR><tag no="94"
name="vb.inf.sfo"/><BR><tag no="95"
name="jj.suv.utr/neu.sin/plu.ind.nom"/><BR><tag no="96"
name="rg.gen"/><BR><tag no="97" name="hp.neu.sin.ind"/><BR><tag
no="98" name="vb.kon.prt"/><BR><tag no="99" name="sen.per"/><BR><tag
no="100" name="ps.utr/neu.plu.def"/><BR><tag no="101"
name="nn.utr.sin.ind.nom.set"/><BR><tag no="102"
name="nn.utr.sin.def.nom"/><BR><tag no="103"
name="pn.utr.plu.def.sub"/><BR><tag no="104"
name="nn.neu.sin.ind.gen"/><BR><tag no="105"
name="ps.neu.sin.def"/><BR><tag no="106"
name="pn.utr.plu.def.obj"/><BR><tag no="107"
name="jj.pos.utr.sin.ind/def.nom"/><BR><tag no="108"
name="vb.prt.sfo"/><BR><tag no="109" name="mad"/><BR><tag no="110"
name="ab"/><BR><tag no="111"
name="pn.utr/neu.sin/plu.def.obj"/><BR><tag no="112"
name="vb.sup.akt"/><BR><tag no="113" name="mid"/><BR><tag no="114"
name="vb.sup.akt.kop"/><BR><tag no="115"
name="jj.pos.mas.sin.def.nom"/><BR><tag no="116"
name="hp.utr/neu.plu.ind"/><BR><tag no="117"
name="vb.sup.akt.mod"/><BR><tag no="118" name="jj.kom.sms"/><BR><tag
no="119" name="nn.utr.sin.def.gen"/><BR><tag no="120"
name="rg.nom"/><BR><tag no="121" name="nn.neu.sin.ind.nom"/><BR><tag
no="122" name="rg.yea"/><BR><tag no="123" name="pl"/><BR><tag
no="124" name="in"/><BR><tag no="125" name="vb.prt.akt"/><BR><tag
no="126" name="nn.neu.sms"/><BR><tag no="127"
name="vb.sup.sfo"/><BR><tag no="128"
name="nn.utr.plu.ind.gen"/><BR><tag no="129"
name="pn.utr.sin.ind.sub/obj"/><BR><tag no="130"
name="dt.utr.sin.def"/><BR><tag no="131"
name="nn.neu.sin.ind.nom.set"/><BR><tag no="132" name="vb"/><BR><tag
no="133" name="pp"/><BR><tag no="134"
name="vb.prs.akt.kop"/><BR><tag no="135"
name="nn.utr.sin.ind.gen"/><BR><tag no="136" name="jj.gen"/><BR><tag
no="137" name="vb.prt.akt.kop"/><BR><tag no="138"
name="ie"/><BR><tag no="139" name="ro.mas.sin.ind/def.nom"/><BR><tag
no="140" name="jj.pos.utr/neu.sin/plu.ind/def.nom"/><BR><tag no="141"
name="hp.utr.sin.ind"/><BR><tag no="142"
name="pc.prs.utr/neu.sin/plu.ind/def.nom"/><BR><tag no="143"
name="sen.non"/><BR><tag no="144"
name="pn.utr/neu.plu.def.sub"/><BR><tag no="145" name="ha"/><BR><tag
no="146" name="vb.prs.akt.aux"/><BR><tag no="147"
name="ab.pos"/><BR><tag no="148"
name="pm.sms"/><BR></tags><BR><rules><categories><category> \
<name>nprecog</name><BR><count>0</count><BR></category>< \
BR><category><name>abrecog</name><BR><count>0</count><BR \
></category><BR><category><name>qnrecog</name><BR><count> \
> ;0</count><BR></category><BR><category><name>acc</name> \
> ;<BR><count>0</count><BR></category><BR><category><name&g \
> t;jjrecog</name><BR><count>0</count><BR></category><BR><c \
> ategory><name>vbrecog</name><BR><count>0</count><BR></ \
> category><BR><category><name>clrecog</name><BR><info>CL&l \
> t;/info><BR><count>0</count><BR></category><BR><category> \
> <name>pprecog</name><BR><count>0</count><BR></category> \
> ;<BR><category><name>prob</name><BR><info>PROB</info>< \
> BR><count>0</count><BR></category><BR></categories><BR><rules_used></rules_used><BR></rules><BR></Root></FONT></DIV>
>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial
size=2>--------------------------------------------------------------------------------------------------</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2>The primer.xsd file:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2><?xml version="1.0" encoding="ISO-8859-1"
standalone="yes" ?> <BR><xs:schema xmlns:xs="<A
href="http://www.w3.org/2001/XMLSchema">http://www.w3.org/2001/XMLSchema</A>"><BR> <xs:element \
name="Root"><BR> <xs:complexType><BR>
<xs:sequence><BR> <xs:element name="s" minOccurs="0"
maxOccurs="unbounded"><BR>
<xs:complexType><BR>
<xs:sequence><BR> <xs:element
name="words" ><BR>
<xs:complexType><BR>
<xs:sequence><BR>
<xs:any /><BR>
</xs:sequence><BR>
</xs:complexType><BR>
</xs:element><BR> <xs:element
name="text" ><BR>
<xs:complexType><BR>
<xs:sequence><BR>
<xs:any /><BR>
</xs:sequence><BR>
</xs:complexType><BR>
</xs:element><BR> <xs:element
name="paragraph" minOccurs="0"
><BR>
<xs:complexType><BR>
<xs:sequence><BR>
<xs:any /><BR>
</xs:sequence><BR>
</xs:complexType><BR>
</xs:element><BR> <xs:element
name="contents" ><BR>
<xs:complexType><BR>
<xs:sequence><BR>
<xs:any /><BR>
</xs:sequence><BR>
</xs:complexType><BR>
</xs:element><BR> <xs:element
name="matchings" ><BR> <xs:complexType
minOccurs="0"><BR>
<xs:sequence><BR>
<xs:any /><BR>
</xs:sequence><BR> </xs:complexType><BR> \
</xs:element> <BR> <xs:element
name="analysis" ><BR> <xs:complexType
minOccurs="0"><BR>
<xs:sequence><BR>
<xs:any /><BR>
</xs:sequence><BR> </xs:complexType><BR> \
</xs:element> <BR> <xs:element
name="bio" minOccurs="0" ><BR>
<xs:complexType><BR>
<xs:sequence><BR>
<xs:element name="row" type="xs:string" minOccurs="0" maxOccurs="unbounded"
/><BR>
</xs:sequence><BR>
</xs:complexType><BR>
</xs:element><BR> <xs:element
name="models" ><BR> <xs:complexType
minOccurs="0"><BR>
<xs:sequence><BR>
<xs:any /><BR>
</xs:sequence><BR> </xs:complexType><BR> \
</xs:element><BR> <xs:element
name="final_result" ><BR> <xs:complexType
minOccurs="0"><BR>
<xs:sequence><BR>
<xs:any /><BR>
</xs:sequence><BR> </xs:complexType><BR> \
</xs:element><BR> <xs:element
name="sent_comm" minOccurs="0" ><BR>
<xs:complexType
minOccurs="0"><BR>
<xs:sequence><BR>
<xs:any /><BR>
</xs:sequence><BR> </xs:complexType><BR> \
</xs:element><BR>
</xs:sequence><BR> <xs:attribute
name="ref" type="xs:integer" use="optional" /> <BR>
</xs:complexType><BR>
</xs:element><BR> <xs:element name="scrutinizer"
minOccurs="0" ><BR> <xs:complexType
minOccurs="0"><BR>
<xs:sequence><BR> <xs:any
/><BR>
</xs:sequence><BR>
</xs:complexType><BR>
</xs:element><BR> <xs:element name="results"
minOccurs="0" ><BR> <xs:complexType minOccurs="0"
><BR>
<xs:sequence><BR> <xs:any
/><BR>
</xs:sequence><BR>
</xs:complexType><BR>
</xs:element><BR> <xs:element name="tags"
minOccurs="0" ><BR> <xs:complexType minOccurs="0"
><BR>
<xs:sequence><BR> <xs:any
/><BR>
</xs:sequence><BR>
</xs:complexType><BR>
</xs:element><BR> <xs:element name="rules"
minOccurs="0" ><BR> <xs:complexType minOccurs="0"
><BR>
<xs:sequence><BR> <xs:any
/><BR>
</xs:sequence><BR>
</xs:complexType><BR>
</xs:element><BR> </xs:sequence><BR>
</xs:complexType><BR> </xs:element><BR></xs:schema></FONT></DIV>
<DIV><FONT face=Arial size=2> </DIV>
<DIV><BR></DIV></FONT></BODY></HTML>
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
minimalist@exolab.org with a subject of:
unsubscribe castor-dev
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic