Hi Nuno,
Empty elements are nothing unusual - there are many instances of this in
the JiBX tests, for instance - but somehow the parser is missing the '>'
character ending the start tag in your case. I suggested adding some
whitespace before the start tag to see if this might be an obscure
buffering problem that happens because you're hitting a particular
offset with a multibyte character, or something of the sort.
You can send me (directly) the document and I can take a look at it. To
try to isolate the problem, you can try a simple program using the
org.jibx.extras.DocumentComparator to read two copies of the document in
parallel - if the problem is with the parser itself, it should still
happen when you do this. You can also try passing in a Reader rather
than an InputStream to JiBX, which again will change the logic paths and
might help isolate where the problem is occurring.
- Dennis
Nuno Ferreira wrote:
Hi,
It seems that if we have empty tags in the xml document it occurs
this execption :
Error parsing document (line 68, col 15)
org.xmlpull.v1.XmlPullParserException: start tag
unexpected
character < (position: TEXT seen
...</DadosVeiculos>n<DadosOficina<... @68:15)
at org.xmlpull.mxp1.MXParser.parseStartTag (MXParser.java:1803)
at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1259)
at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093)
at org.jibx.runtime.impl.UnmarshallingContext.isAt(Unknown Source)
at
pt.aps.details.cids.mensagem.JiBX_MS_CIDSInfoOficinaDetails_access.isPresent
()
at
pt.aps.details.cids.mensagem.MensagemCIDSDetails.JiBX_MS_CIDS_unmarshal_2_2(MensagemCIDSDetails.java)
at
pt.aps.cids.mensagem.MensagemCIDSLN.JiBX_MS_CIDS_unmarshal_2_2(MensagemCIDSLN.java)
at
pt.aps.cids.mensagem.JiBX_MS_CIDSMensagemCIDSLN_access.unmarshal ()
at
org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement (Unknown
Source)
at
org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(Unknown
Source)
at pt.aps.batch.Batch.unMarshall(Batch.java:172)
...
Dennis, the character encoding we are using is the UTF-8, but it seems
that this is not a encoding problem because it happens to with
different encodings like ISO-8859-1.
The unmarshal only works when we put something ( whitespace, <enter> ,
...) inside the tag.
I've already check the document in a hex byte viewer and i didn't
found nothing weird in the bytes making up the tag.
Any other ideas?
cheers
On 01/11/05, *Dennis Sosnoski* <[EMAIL PROTECTED]
<mailto:[EMAIL PROTECTED]>> wrote:
Hi Nuno,
I've never seen anything like this, though it may be some kind of
subtle
error in the character handling. What character encoding are you
using
in your document? Also, try adding some more whitespace before the
<DadosOficina> start tag and see if that makes a difference. Finally,
check your document in a hex byte viewer to make sure there's nothing
weird in the bytes making up that start tag (depending on the
encoding,
this could take several different forms).
- Dennis
Nuno Ferreira wrote:
> Hi,
>
> We having a problem parsing a xml document to do the unMarshall
> method.
>
> It seems that if we have empty tags in the xml document it
occurs
> this execption :
>
> Error parsing document (line 68, col 15)
> org.xmlpull.v1.XmlPullParserException : start tag unexpected
> character < (position: TEXT seen
> ...</DadosVeiculos>\n<DadosOficina<... @68:15)
> at org.xmlpull.mxp1.MXParser.parseStartTag (MXParser.java:1803)
> at org.xmlpull.mxp1.MXParser.nextImpl(MXParser.java:1259)
> at org.xmlpull.mxp1.MXParser.next(MXParser.java:1093)
> at org.jibx.runtime.impl.UnmarshallingContext.isAt(Unknown
Source)
> at
>
pt.aps.details.cids.mensagem.JiBX_MS_CIDSInfoOficinaDetails_access.isPresent
> ()
> at
>
pt.aps.details.cids.mensagem.MensagemCIDSDetails.JiBX_MS_CIDS_unmarshal_2_2(MensagemCIDSDetails.java
)
> at
>
pt.aps.cids.mensagem.MensagemCIDSLN.JiBX_MS_CIDS_unmarshal_2_2(MensagemCIDSLN.java)
> at
>
pt.aps.cids.mensagem.JiBX_MS_CIDSMensagemCIDSLN_access.unmarshal ()
> at
>
org.jibx.runtime.impl.UnmarshallingContext.unmarshalElement(Unknown
> Source)
> at
>
org.jibx.runtime.impl.UnmarshallingContext.unmarshalDocument(Unknown
> Source)
> at pt.aps.batch.Batch.unMarshall(Batch.java:172)
> ...
>
> This is a small example of my xml, with the tag
> <DadosOficina></DadosOficina> with no text or elements.
>
> <DadosVeiculos>
> <ChassisCredora>DSAJKL</ChassisCredora>
> <ChassisDevedora>AJKSDJKL</ChassisDevedora>
> <MarcaCredora>Z12</MarcaCredora>
> <DescMarcaCredora>DFSJKDFJKL</DescMarcaCredora>
> <ModeloCredora>1</ModeloCredora>
> <DescModeloCredora>SKSJKJKL</DescModeloCredora>
> <TipoVeiculo>1031</TipoVeiculo>
> <VersaoVeiculo>KJAKDS</VersaoVeiculo>
> <AnoConstrucao>2000</AnoConstrucao>
> <QuantificacaoExtras>12</QuantificacaoExtras>
> <ValorExtras>1000,0</ValorExtras>
> </DadosVeiculos>
> <DadosOficina></DadosOficina>
>
> We do a test and place an <Enter> inside the tag.
> <DadosOficina>
> </DadosOficina>
>
> It works, but it´s very bad do this kind of thing.
>
> Does anybody have an idea about this???
>
> cheers
>
>
-------------------------------------------------------
This SF.Net email is sponsored by the JBoss Inc.
Get Certified Today * Register for a JBoss Training Course
Free Certification Exam for All Training Attendees Through End of 2005
Visit http://www.jboss.com/services/certification for more information
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
<mailto:jibx-users@lists.sourceforge.net>
https://lists.sourceforge.net/lists/listinfo/jibx-users
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users