dev@fi.java.net

Re: AttributesHolder

From: Paul Sandoz <Paul.Sandoz_at_Sun.COM>
Date: Fri, 20 Oct 2006 10:29:52 +0200

Hi Alan,

This is the correct list.

What version of FI are you looking at, see here for AttributesHolder [1]
version 1.8 (for FI 1.1.x). It may be you are looking at an old one?

The AttributesHolder.convertEncodingAlgorithmDataToString will convert
any built in or registered encoding algorithm.

The AttributesHolder.getValue(int index) will always return a string and
convert the algorithm data if necessary.

Ah!, but there is a bug for getValue(String uri, String localName), was
this the method you were using?

This method was not updated to do conversion. I have fixed this, which
should be in the latest builds [2]. Let me know if you require a version
rev so you have a location to a stable fixed distribution.

Paul.

[1]
http://fisheye5.cenqua.com/browse/fi/FastInfoset/src/com/sun/xml/fastinfoset/sax/AttributesHolder.java?r=1.8
[2]
https://fi.dev.java.net/servlets/ProjectDocumentList?folderID=5845&expandFolder=5845&folderID=5844

Alan Hudson wrote:
> Paul, this may not be the right list now but I haven't posted in ahile.
> If it isn't can you redirect to the right place?
>
> Looking at AttributesHolder.convertEncodingAlgorithmDataToString
>
> I notice it throws an exception when asked to handle a builtin
> algorithm. This means calling getValue on it will return null.
>
> I feel like I ran into this before and worked around it. But I'd like
> to discuss it a bit this time.
>
> I've got a SAX stream output from my X3D processor. For our XML output
> I just have a ContentHandler pretty printer. But right now when it
> calls getValue on the attribute it doesn't get anything to print. I
> could call getAlgotithmData at that point and work from there. But is
> there a reason getValue shouldn't return something useful?
>
> Right now I can't write a generic printer that doesn't need to import
> AttributesHolder. Ie I'd prefer to stick with the Attributes interface
> only.

-- 
| ? + ? = To question
----------------\
    Paul Sandoz
         x38109
+33-4-76188109

attached mail follows:



User: sandoz
Date: 2006/10/20 01:23:36

Modified:
   fi/FastInfoset/src/com/sun/xml/fastinfoset/sax/AttributesHolder.java

Log:
 Ensure that getValue converts encoding algorithm data to string.

File Changes:

Directory: /fi/FastInfoset/src/com/sun/xml/fastinfoset/sax/
===========================================================

File [changed]: AttributesHolder.java
Url: https://fi.dev.java.net/source/browse/fi/FastInfoset/src/com/sun/xml/fastinfoset/sax/AttributesHolder.java?r1=1.8&r2=1.9
Delta lines: +1 -1
-------------------
--- AttributesHolder.java 28 Aug 2006 12:18:39 -0000 1.8
+++ AttributesHolder.java 20 Oct 2006 08:23:33 -0000 1.9
@@ -184,7 +184,7 @@
     public final String getValue(String uri, String localName) {
         int index = getIndex(uri, localName);
         if (index >= 0) {
- return _values[index];
+ return getValue(index);
         } else {
             return null;
         }




---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe_at_fi.dev.java.net
For additional commands, e-mail: cvs-help_at_fi.dev.java.net