users@fi.java.net

AW: Problem with FastInfosetSource and Namespaces

From: Gaussmann, Horst <Horst.Gaussmann_at_partner.commerzbank.com>
Date: Thu, 6 Apr 2006 17:50:48 +0200

I've got the latest version of this class but if the setFeature methode with
Features.NAMESPACES_FEATURE and true is called it goes to the latest else
and throws an exception.

greetings horst

-----Ursprüngliche Nachricht-----
Von: Alan Hudson [mailto:giles_at_yumetech.com]
Gesendet: Donnerstag, 6. April 2006 17:34
An: users_at_fi.dev.java.net
Betreff: Re: Problem with FastInfosetSource and Namespaces

Gaussmann, Horst wrote:
> Hello,
>
> i try to transform a FastInfoset document using Saxon as the
> Transformer. So my problem is that saxon tries to set the Namespaces
> feature but the SAXDocumentParser used from FastInfosetSource claims
> to handle this feature see getFeature but if saxon tries to set it an
> Exception is thrown. So what's up support or not support of the
> feature ?
>
> public boolean getFeature(String name)
> throws SAXNotRecognizedException, SAXNotSupportedException {
> if (name.equals(Features.NAMESPACES_FEATURE)) {
> return true; ...
>
> public void setFeature(String name, boolean value)
> throws SAXNotRecognizedException, SAXNotSupportedException {
> if (name.equals(Features.NAMESPACES_FEATURE)
> && value == false) {
> throw new SAXNotSupportedException(name + ":" + value);
> } else if (name.equals(Features.NAMESPACE_PREFIXES_FEATURE)) {
> _namespacePrefixesFeature = value;
> } else if (name.equals(Features.STRING_INTERNING_FEATURE) ||
> name.equals(FastInfosetReader.STRING_INTERNING_PROPERTY))
{
> setStringInterning(value);
> } else {
> throw new SAXNotRecognizedException(
>
> CommonResourceBundle.getInstance().getString("message.featureNotSuppor
> ted")
> + name);
> }
>
That was fixed a month or two ago. Check the latest source. The new latest
version of SAXDocumentParser is 1.41

it now says:
     public boolean getFeature(String name)
     throws SAXNotRecognizedException, SAXNotSupportedException {
         if (name.equals(Features.NAMESPACES_FEATURE)) {
             return true;
         } else if (name.equals(Features.NAMESPACE_PREFIXES_FEATURE)) {
             return _namespacePrefixesFeature;
         } else if (name.equals(Features.STRING_INTERNING_FEATURE) ||
                 name.equals(FastInfosetReader.STRING_INTERNING_PROPERTY)) {
             return getStringInterning();
         } else {
             throw new SAXNotRecognizedException(
 
CommonResourceBundle.getInstance().getString("message.featureNotSupported")
+ name);
         }
     }

--
Alan Hudson
President Yumetech, Inc.                               www.yumetech.com
President Web3D Consortium                             www.web3d.org
206 340 8900
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_fi.dev.java.net For additional
commands, e-mail: users-help_at_fi.dev.java.net