PDA

View Full Version : [JAVA] Errore parsing xml:SAXParseException: [xX][mM][lL]" is not allowed


Abdujaparov
22-05-2008, 16:07
Ciao a tutti, devo elaborare un file xml che mi viene inviato in una envelop soap, solo che mi viene dato l'errore:

16:14:40,887 ERROR [STDERR] [Fatal Error] :1:203: The processing instruction target matching "[xX][mM][lL]" is not allowed.
16:14:40,889 ERROR [STDERR] org.xml.sax.SAXParseException: The processing instruction target matching "[xX][mM][lL]" is not allowed.
16:14:40,890 ERROR [STDERR] at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)

quando faccio il parsing del documento.
Il file di cui devo fare il parsing è il seguente:

<env:Envelope xmlns:env='http://schemas.xmlsoap.org/soap/envelope/'>
<env:Header></env:Header><env:Body><ns2:getComponentFacetByStringResponse xmlns:ns2="http://repository.opuce.eu"><facetXMLString><?xml version="1.0" encoding="UTF-8"?>
<!--Sample XML file generated by XMLSPY v2004 rel. 4 U (http://www.xmlspy.com)-->
<Facet xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation=".\ComponentSpecSemanticFacet.xsd">
<ServiceID>GetAllContext</ServiceID>
<Type>OPUCESemanticDescription</Type>
<Language>ServiceSemantics</Language>
<Data>
<OwnerTags>
<Tag xml:lang="en">Context</Tag>
<Tag xml:lang="it">Contesto</Tag>
<Tag xml:lang="es">Contesto</Tag>
</OwnerTags>
<UserTags>
<Tag xml:lang="en">Context</Tag>
<Tag xml:lang="it">Contesto</Tag>
<Tag xml:lang="es">Contesto</Tag>
</UserTags>
<Keywords>
<Keyword id="1.3" name="Context" >
<labels>
<label xml:lang="en">Context-aware Services</label>
<label xml:lang="it">Servizi di contesto</label>
<label xml:lang="es"></label>

</labels>
</Keyword>
</Keywords>
</Data>
</Facet></facetXMLString></ns2:getComponentFacetByStringResponse></env:Body></env:Envelope>

Cercando su google mi pare di aver capito che il problema sta nella zona vicino a: <?xml version="1.0" encoding="UTF-8"?>, mi sembra di aver letto che ciò sia dovuto a qualche spazio bianco che però lì non vedo da nessuna parte.
Qualcuno potrebbe spiegarmi dove sta l'errore e come risolverlo?
Grazie a tutti, ciao ciao.