On 2 Dec 2003, at 14:11, Fr�d�ric Laurent wrote:

On Tuesday 02 Dec 2003 10:01 am, you wrote:
hi all,

What's the best way to retrieve the namespace declarations of an XML
element/document ? For instance in case of the document snippet below, I
would like to be able to acquire a Hashtable or something, holding the
values { (tns, http://example.com/stockquote.wsdl), (xsd1,
http://example.com/stockquote.xsd), ... }, or something like that.


<definitions name="StockQuote"
targetNamespace="http://example.com/stockquote.wsdl";
          xmlns:tns="http://example.com/stockquote.wsdl";
          xmlns:xsd1="http://example.com/stockquote.xsd";
          xmlns:soap="http://schemas.xmlsoap.org/wsdl/soap/";
          xmlns="http://schemas.xmlsoap.org/wsdl/";>
(...)
      <input message="tns:GetLastTradePriceInput"/>
(...)
</definition>

Do you have to use Digester for this? If you do not then you could use
SAX2,
and the namespace information would be available to you via callbacks.

http://www.saxproject.org/?selected=namespaces


You mean that the digester does not handle namespaces ? Then you can not write a version of the RSS digester for RSS 1.0 (with RDF, DublinCore,... namespaces)

the digester for RSS 0.9 is here
http://jakarta.apache.org/commons/digester/api/org/apache/commons/ digester/rss/package-summary.html



too bad... isn't it ?

i don't think that janek had intended to imply that digester doesn't support namespaces (at least to some extent). the namespace information is made available to the Rule implementations and there is some namespace support in the standard matching Rules.


but digester doesn't provide anywhere near comprehensive handling for namespaces. for that, it's often necessary to use the SAX layer that underlies digester.

- robert

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]



Reply via email to