You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-users@xerces.apache.org by Rida Ligurs <RL...@webplan.com> on 2002/10/23 20:17:18 UTC

Problem getting namespaceURI from SAX endElement event

Hi there,

I've just upgrade to Xerces 2.2.0 from 1.4.4 and found that the SAX parser
isn't behaving in the same way.


I have a sample document that I parse using the DocumentTracer sample
included with Xerces 2.2.0.  For some reason the namespaceURI on all
endElements are missing.


Here's my sample document:


<SOAP-ENV:Envelope
xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
	<SOAP-ENV:Header>
		<prop:properties SOAP-ENV:mustUnderstand="1"
xmlns:prop="urn:schemas-company-com:Test:Properties:2.0">
			<prop:id>01</prop:id>
		</prop:properties>
	</SOAP-ENV:Header>
	<SOAP-ENV:Body/>
</SOAP-ENV:Envelope>



Here's my command line from DocumentTracer:

java -classpath xercesImpl.jar;xercesSamples.jar;xmlParserAPIs.jar
sax.DocumentTracer file:/c:/test/test.xml



Here's the output from DocumentTracer:

setDocumentLocator(locator=org.apache.xerces.parsers.AbstractSAXParser$Locat
orProxy@67d940)
startDocument()
 
startPrefixMapping(prefix="SOAP-ENV",uri="http://schemas.xmlsoap.org/soap/en
velope/")
 
startElement(uri="http://schemas.xmlsoap.org/soap/envelope/",localName="Enve
lope",qname="SOAP-ENV:Envelope",attributes={})
  characters(text="\n\t")
 
startElement(uri="http://schemas.xmlsoap.org/soap/envelope/",localName="Head
er",qname="SOAP-ENV:Header",attributes={})
   characters(text="\n\t\t")
 
startPrefixMapping(prefix="prop",uri="urn:schemas-company-com:Test:Propertie
s:2.0")
 
startElement(uri="urn:schemas-company-com:Test:Properties:2.0",localName="pr
operties",qname="prop:properties",attributes={{uri="http://schemas.xmlsoap.o
rg/soap/envelope/",localName="mustUnderstand",qname="SOAP-ENV:mustUnderstand
",type="CDATA",value="1"}})
    characters(text="\n\t\t\t")
 
startElement(uri="urn:schemas-company-com:Test:Properties:2.0",localName="id
",qname="prop:id",attributes={})
     characters(text="01")
    endElement(uri="",localName="id",qname="prop:id")
    characters(text="\n\t\t")
   endElement(uri="",localName="properties",qname="prop:properties")
   endPrefixMapping(prefix="prop")
   characters(text="\n\t")
  endElement(uri="",localName="Header",qname="SOAP-ENV:Header")
  characters(text="\n\t")
 
startElement(uri="http://schemas.xmlsoap.org/soap/envelope/",localName="Body
",qname="SOAP-ENV:Body",attributes={})
 
endElement(uri="http://schemas.xmlsoap.org/soap/envelope/",localName="Body",
qname="SOAP-ENV:Body")
  characters(text="\n")
 endElement(uri="",localName="Envelope",qname="SOAP-ENV:Envelope")
 endPrefixMapping(prefix="SOAP-ENV")
endDocument()



Does anyone know why I'm not getting any uri values for my endElements? 


Hope someone can point me in the right direction!


Rida

Re: Problem getting namespaceURI from SAX endElement event

Posted by James Bates <ja...@amplexor.com>.
I've had the same problem, and Elena Litani had at the time kindly pointed out 
that is a known issue with the latest Xerces versions, but that the CVS 
version of Xerces has already fixed it.

To use the latest Xerces, you should therefore probably obtain the CVS 
version.

James

On Wednesday 23 October 2002 18:17, Rida Ligurs wrote:
> Hi there,
>
> I've just upgrade to Xerces 2.2.0 from 1.4.4 and found that the SAX parser
> isn't behaving in the same way.
>
>
> I have a sample document that I parse using the DocumentTracer sample
> included with Xerces 2.2.0.  For some reason the namespaceURI on all
> endElements are missing.
>
>
> Here's my sample document:
>
>
> <SOAP-ENV:Envelope
> xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/">
> 	<SOAP-ENV:Header>
> 		<prop:properties SOAP-ENV:mustUnderstand="1"
> xmlns:prop="urn:schemas-company-com:Test:Properties:2.0">
> 			<prop:id>01</prop:id>
> 		</prop:properties>
> 	</SOAP-ENV:Header>
> 	<SOAP-ENV:Body/>
> </SOAP-ENV:Envelope>
>
>
>
> Here's my command line from DocumentTracer:
>
> java -classpath xercesImpl.jar;xercesSamples.jar;xmlParserAPIs.jar
> sax.DocumentTracer file:/c:/test/test.xml
>
>
>
> Here's the output from DocumentTracer:
>
> setDocumentLocator(locator=org.apache.xerces.parsers.AbstractSAXParser$Loca
>t orProxy@67d940)
> startDocument()
>
> startPrefixMapping(prefix="SOAP-ENV",uri="http://schemas.xmlsoap.org/soap/e
>n velope/")
>
> startElement(uri="http://schemas.xmlsoap.org/soap/envelope/",localName="Env
>e lope",qname="SOAP-ENV:Envelope",attributes={})
>   characters(text="\n\t")
>
> startElement(uri="http://schemas.xmlsoap.org/soap/envelope/",localName="Hea
>d er",qname="SOAP-ENV:Header",attributes={})
>    characters(text="\n\t\t")
>
> startPrefixMapping(prefix="prop",uri="urn:schemas-company-com:Test:Properti
>e s:2.0")
>
> startElement(uri="urn:schemas-company-com:Test:Properties:2.0",localName="p
>r
> operties",qname="prop:properties",attributes={{uri="http://schemas.xmlsoap.
>o
> rg/soap/envelope/",localName="mustUnderstand",qname="SOAP-ENV:mustUnderstan
>d ",type="CDATA",value="1"}})
>     characters(text="\n\t\t\t")
>
> startElement(uri="urn:schemas-company-com:Test:Properties:2.0",localName="i
>d ",qname="prop:id",attributes={})
>      characters(text="01")
>     endElement(uri="",localName="id",qname="prop:id")
>     characters(text="\n\t\t")
>    endElement(uri="",localName="properties",qname="prop:properties")
>    endPrefixMapping(prefix="prop")
>    characters(text="\n\t")
>   endElement(uri="",localName="Header",qname="SOAP-ENV:Header")
>   characters(text="\n\t")
>
> startElement(uri="http://schemas.xmlsoap.org/soap/envelope/",localName="Bod
>y ",qname="SOAP-ENV:Body",attributes={})
>
> endElement(uri="http://schemas.xmlsoap.org/soap/envelope/",localName="Body"
>, qname="SOAP-ENV:Body")
>   characters(text="\n")
>  endElement(uri="",localName="Envelope",qname="SOAP-ENV:Envelope")
>  endPrefixMapping(prefix="SOAP-ENV")
> endDocument()
>
>
>
> Does anyone know why I'm not getting any uri values for my endElements?
>
>
> Hope someone can point me in the right direction!
>
>
> Rida


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org


RE: Problem getting namespaceURI from SAX endElement event

Posted by Olle Sundblad <ol...@eris.se>.
> I've just upgrade to Xerces 2.2.0 from 1.4.4 and found that the SAX parser
isn't
> behaving in the same way.
>
>
> I have a sample document that I parse using the DocumentTracer sample
included
> with Xerces 2.2.0.  For some reason the namespaceURI on all endElements
are missing.

I noticed the same problem a few weeks back, it was a bug that is now fixed.
Get the "latest release" at
http://gump.covalent.net/jars/latest/xml-xerces2/ (for more info see below).


/Olle


From: Elena Litani [mailto:elitani@ca.ibm.com]
Sent: den 7 oktober 2002 16:19
To: xerces-j-user@xml.apache.org
Subject: Re: Problem with end element


Andy Clark wrote:
> Olle Sundblad wrote:
> > Since upgrading to Xerces 2_2_0 (from version 1_2_3), I don't receive
any
> > uri in the endElement callback (see bleow) when using the SAX-parser
that is
> I'm really surprised something like this could happen.

I've just committed the fix. There was a bug in the new scanner (that
also does namespace binding).

Please, pick up the new code from CVS or the jars from
http://gump.covalent.net/jars/latest/xml-xerces2/ and verify the fix.
Thanks!
--
Elena Litani / IBM Toronto


---------------------------------------------------------------------
To unsubscribe, e-mail: xerces-j-user-unsubscribe@xml.apache.org
For additional commands, e-mail: xerces-j-user-help@xml.apache.org