You are viewing a plain text version of this content. The canonical link for it is here.
Posted to j-dev@xerces.apache.org by "Lucian Holland (JIRA)" <xe...@xml.apache.org> on 2006/08/15 14:26:13 UTC

[jira] Created: (XERCESJ-1178) Error getting prefix for an attribute with no namespace

Error getting prefix for an attribute with no namespace
-------------------------------------------------------

                 Key: XERCESJ-1178
                 URL: http://issues.apache.org/jira/browse/XERCESJ-1178
             Project: Xerces2-J
          Issue Type: Bug
          Components: StAX
    Affects Versions: 2.8.0
            Reporter: Lucian Holland


The initialElementAttrs()  method of SAXXMLStreamReader sets the prefix of attributes to null if it finds no colon in the attribute name; the problem with this is that getAttributeNamespace() uses this prefix when looking up the namespace uri with a call to getNamespaceURI on the NamespaceContextImpl, and this method throws an IllegalArgumentException if null is passed in. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Updated: (XERCESJ-1178) Error getting prefix for an attribute with no namespace

Posted by "hua lei (JIRA)" <xe...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XERCESJ-1178?page=all ]

hua lei updated XERCESJ-1178:
-----------------------------

    Attachment: stax_patch_8.19.zip

Hello, Michael,
       The whole StAX implementation is improved a lot in attached patch, including: 

SAXXMLStreamReader:

1) I modified the  SAX implementation to save the namespace URI of elements and attributes if reported by SAX parser, which sloves the problem you mentioned. 

2) "public void require(int type, String namespaceURI, String localName) throws XMLStreamException"  is realized

3) "public boolean isAttributeSpecified(int index)" is realized

4)  javax.xml.stream.isCoalescing attribute is realized

5)  javax.xml.stream.isReplaceEntityRef attribute is partly realized, because it heavily depends on the SAX implementation

6)  "public Location getLocation()" is modified and tested.

7)  getTextXXX() methods,  NamespaceContext and Exception reporting of SAXXMLStreamReader are improved 

DOMXMLStreamReader:

1) The EntityReferrence type is partly supported in "public String getText()" and "public String getLocalName()" , it also heavily depends on the DOM implementation 


Also, the testing of StAX component is improved a lot. Besides the test cases of  myself, I also use test cases from http://stax.codehaus.org/. The SAX implementation has passed all test cases about Element, Attribute, Namespace and isCoalescing property from http://stax.codehaus.org.  I'll let DOM implementation pass these test cases tomorrow.



> Error getting prefix for an attribute with no namespace
> -------------------------------------------------------
>
>                 Key: XERCESJ-1178
>                 URL: http://issues.apache.org/jira/browse/XERCESJ-1178
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: StAX
>    Affects Versions: 2.8.0
>            Reporter: Lucian Holland
>         Attachments: stax_patch_8.19.zip
>
>
> The initialElementAttrs()  method of SAXXMLStreamReader sets the prefix of attributes to null if it finds no colon in the attribute name; the problem with this is that getAttributeNamespace() uses this prefix when looking up the namespace uri with a call to getNamespaceURI on the NamespaceContextImpl, and this method throws an IllegalArgumentException if null is passed in. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Resolved: (XERCESJ-1178) Error getting prefix for an attribute with no namespace

Posted by "Michael Glavassevich (JIRA)" <xe...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XERCESJ-1178?page=all ]

Michael Glavassevich resolved XERCESJ-1178.
-------------------------------------------

    Resolution: Fixed

Thanks Hua.  I've committed your most recent patch to SVN.  Though I don't think it's necessary, I've left the duplicate attribute checking code alone for now.

> Error getting prefix for an attribute with no namespace
> -------------------------------------------------------
>
>                 Key: XERCESJ-1178
>                 URL: http://issues.apache.org/jira/browse/XERCESJ-1178
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: StAX
>    Affects Versions: 2.8.0
>            Reporter: Lucian Holland
>         Assigned To: Michael Glavassevich
>         Attachments: stax_patch_8.19.zip, stax_patch_8.20.zip, stax_patch_8.23.zip
>
>
> The initialElementAttrs()  method of SAXXMLStreamReader sets the prefix of attributes to null if it finds no colon in the attribute name; the problem with this is that getAttributeNamespace() uses this prefix when looking up the namespace uri with a call to getNamespaceURI on the NamespaceContextImpl, and this method throws an IllegalArgumentException if null is passed in. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Commented: (XERCESJ-1178) Error getting prefix for an attribute with no namespace

Posted by "hua lei (JIRA)" <xe...@xml.apache.org>.
    [ http://issues.apache.org/jira/browse/XERCESJ-1178?page=comments#action_12428307 ] 
            
hua lei commented on XERCESJ-1178:
----------------------------------

A null value check should be done before looking up the namespace uri .

> Error getting prefix for an attribute with no namespace
> -------------------------------------------------------
>
>                 Key: XERCESJ-1178
>                 URL: http://issues.apache.org/jira/browse/XERCESJ-1178
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: StAX
>    Affects Versions: 2.8.0
>            Reporter: Lucian Holland
>
> The initialElementAttrs()  method of SAXXMLStreamReader sets the prefix of attributes to null if it finds no colon in the attribute name; the problem with this is that getAttributeNamespace() uses this prefix when looking up the namespace uri with a call to getNamespaceURI on the NamespaceContextImpl, and this method throws an IllegalArgumentException if null is passed in. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Updated: (XERCESJ-1178) Error getting prefix for an attribute with no namespace

Posted by "hua lei (JIRA)" <xe...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XERCESJ-1178?page=all ]

hua lei updated XERCESJ-1178:
-----------------------------

    Attachment: stax_patch_8.23.zip

>In my test code I wasn't calling the close() method so it was this
>last case that was the issue. While I agree that applications should
>be calling this method they don't have to and if they drop all 
>references to the XMLStreamReader, it and all of its internals should
>get garbage collected.  If the XMLStreamReader gets garbage collected
>without the AsyncSAXParser thread being terminated it will cause a
>memory leak because the thread can't be garabage collected until it 
>terminates. A finalize() method should be added to the XMLStreamReader
>to make sure that the thread gets terminated.

A finalize() method is added to the SAXXMLStreamReader to teminate the  AsyncSAXParser thread. 

>All namespace-aware parsers must check this condition [1]. If they 
>don't its a bug. In what case are you seeing this behaviour?

According to my tests, both xerces and crimson cann't recognize this case.



> Error getting prefix for an attribute with no namespace
> -------------------------------------------------------
>
>                 Key: XERCESJ-1178
>                 URL: http://issues.apache.org/jira/browse/XERCESJ-1178
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: StAX
>    Affects Versions: 2.8.0
>            Reporter: Lucian Holland
>         Assigned To: Michael Glavassevich
>         Attachments: stax_patch_8.19.zip, stax_patch_8.20.zip, stax_patch_8.23.zip
>
>
> The initialElementAttrs()  method of SAXXMLStreamReader sets the prefix of attributes to null if it finds no colon in the attribute name; the problem with this is that getAttributeNamespace() uses this prefix when looking up the namespace uri with a call to getNamespaceURI on the NamespaceContextImpl, and this method throws an IllegalArgumentException if null is passed in. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Assigned: (XERCESJ-1178) Error getting prefix for an attribute with no namespace

Posted by "Michael Glavassevich (JIRA)" <xe...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XERCESJ-1178?page=all ]

Michael Glavassevich reassigned XERCESJ-1178:
---------------------------------------------

    Assignee: Michael Glavassevich

> Error getting prefix for an attribute with no namespace
> -------------------------------------------------------
>
>                 Key: XERCESJ-1178
>                 URL: http://issues.apache.org/jira/browse/XERCESJ-1178
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: StAX
>    Affects Versions: 2.8.0
>            Reporter: Lucian Holland
>         Assigned To: Michael Glavassevich
>         Attachments: stax_patch_8.19.zip
>
>
> The initialElementAttrs()  method of SAXXMLStreamReader sets the prefix of attributes to null if it finds no colon in the attribute name; the problem with this is that getAttributeNamespace() uses this prefix when looking up the namespace uri with a call to getNamespaceURI on the NamespaceContextImpl, and this method throws an IllegalArgumentException if null is passed in. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Commented: (XERCESJ-1178) Error getting prefix for an attribute with no namespace

Posted by "Michael Glavassevich (JIRA)" <xe...@xml.apache.org>.
    [ http://issues.apache.org/jira/browse/XERCESJ-1178?page=comments#action_12429720 ] 
            
Michael Glavassevich commented on XERCESJ-1178:
-----------------------------------------------

Thanks Hua. I've committed your updates to SVN.  A few other comments...

> >The other issue is with the AsyncSAXParser thread. It seems like it never
> >terminates. I noticed that because the JVM wasn't exiting at the end of my
> >test program. I've made it a daemon thread so that the JVM exits but 
> >there's still a threading problem there. Perhaps the call to the parse
> >method on the XMLReader never returns?
> 
> In two cases, the AsyncSAXParser thread will not teminate. 
> 1) There is an exception occures in the SAXXMLStreamReaderImpl
> 2) The user doesn't parse the document to the end 
> 
> To make sure the AsyncSAXParser thread terminates correctly, 
> following modifications are done.
> 1)  When an exception occurs in the next() method the AsyncSAXParser
> thread is interrupted, because after that no call to the 
> StreamReader is valid. 
> 2)  When an exception occures in other methods of StreamReader, a 
> call to StreamReader may still be valid, so the AsyncSAXParser 
> thread shouldn't be interrupted in this case. 
> 3) In the close() method, if the AsyncSAXParser thread is still 
> alive, interrupt it.
> But if the user doesn't close the StreamReader after using it, the 
> AsyncSAXParser thread may never terminate. So user should call the 
> close() method. 

In my test code I wasn't calling the close() method so it was this last case that was the issue. While I agree that applications should be calling this method they don't have to and if they drop all references to the XMLStreamReader, it and all of its internals should get garbage collected.  If the XMLStreamReader gets garbage collected without the AsyncSAXParser thread being terminated it will cause a memory leak because the thread can't be garabage collected until it terminates. A finalize() method should be added to the XMLStreamReader to make sure that the thread gets terminated.

> >In the fix that you made in SAXXMLStreamReader.initialElementAttrs() you
> >added a check for duplicate attributes that I didn't understand. A SAX
> >parser already does this well-formedness check. Is there a reason for
> >doing that again in the XMLStreamReader?
> 
> The SAX parser cann't recognize the element such as  "<root xmlns:
> a='xxx' xmlns:b='xxx' a:attr='1' b:attr='2' />", so I  check it myself.

All namespace-aware parsers must check this condition [1]. If they don't its a bug. In what case are you seeing this behaviour?

[1] http://www.w3.org/TR/xml-names/#uniqAttrs

> Error getting prefix for an attribute with no namespace
> -------------------------------------------------------
>
>                 Key: XERCESJ-1178
>                 URL: http://issues.apache.org/jira/browse/XERCESJ-1178
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: StAX
>    Affects Versions: 2.8.0
>            Reporter: Lucian Holland
>         Assigned To: Michael Glavassevich
>         Attachments: stax_patch_8.19.zip, stax_patch_8.20.zip
>
>
> The initialElementAttrs()  method of SAXXMLStreamReader sets the prefix of attributes to null if it finds no colon in the attribute name; the problem with this is that getAttributeNamespace() uses this prefix when looking up the namespace uri with a call to getNamespaceURI on the NamespaceContextImpl, and this method throws an IllegalArgumentException if null is passed in. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Commented: (XERCESJ-1178) Error getting prefix for an attribute with no namespace

Posted by "Michael Glavassevich (JIRA)" <xe...@xml.apache.org>.
    [ http://issues.apache.org/jira/browse/XERCESJ-1178?page=comments#action_12429337 ] 
            
Michael Glavassevich commented on XERCESJ-1178:
-----------------------------------------------

I just committed your patch. It looks pretty good though I did run into a couple problems when I tried running with the changes. The stack in the namespace context was underflowing because it wasn't pushing on the start of the root element. I "fixed" that by ensuring that the ArrayList is always non-null though I'm not sure that's what you were intending to do here.

java.util.EmptyStackException
at java.util.Stack.peek(Stack.java:85)
at java.util.Stack.pop(Stack.java:67)
at org.apache.xerces.stax.NamespaceContextImpl.onEndElement(NamespaceContextImpl.java:79)
at org.apache.xerces.stax.DOMXMLStreamReaderImpl.initialElementAttrs(DOMXMLStreamReaderImpl.java:318)
at org.apache.xerces.stax.DOMXMLStreamReaderImpl.next(DOMXMLStreamReaderImpl.java:212)
at XMLStreamReaderTest.process(XMLStreamReaderTest.java:62)
at XMLStreamReaderTest.main(XMLStreamReaderTest.java:31)

The other issue is with the AsyncSAXParser thread. It seems like it never terminates. I noticed that because the JVM wasn't exiting at the end of my test program. I've made it a deamon thread so that the JVM exits but there's still a threading problem there. Perhaps the call to the parse method on the XMLReader never returns?

In the fix that you made in SAXXMLStreamReader.initialElementAttrs() you added a check for duplicate attributes that I didn't understand. A SAX parser already does this well-formedness check. Is there a reason for doing that again in the XMLStreamReader?

> Error getting prefix for an attribute with no namespace
> -------------------------------------------------------
>
>                 Key: XERCESJ-1178
>                 URL: http://issues.apache.org/jira/browse/XERCESJ-1178
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: StAX
>    Affects Versions: 2.8.0
>            Reporter: Lucian Holland
>         Assigned To: Michael Glavassevich
>         Attachments: stax_patch_8.19.zip
>
>
> The initialElementAttrs()  method of SAXXMLStreamReader sets the prefix of attributes to null if it finds no colon in the attribute name; the problem with this is that getAttributeNamespace() uses this prefix when looking up the namespace uri with a call to getNamespaceURI on the NamespaceContextImpl, and this method throws an IllegalArgumentException if null is passed in. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Updated: (XERCESJ-1178) Error getting prefix for an attribute with no namespace

Posted by "hua lei (JIRA)" <xe...@xml.apache.org>.
     [ http://issues.apache.org/jira/browse/XERCESJ-1178?page=all ]

hua lei updated XERCESJ-1178:
-----------------------------

    Attachment: stax_patch_8.20.zip

The stack underflowing is fixed. 

>The other issue is with the AsyncSAXParser thread. It seems like it never
>terminates. I noticed that because the JVM wasn't exiting at the end of my
>test program. I've made it a daemon thread so that the JVM exits but 
>there's still a threading problem there. Perhaps the call to the parse
>method on the XMLReader never returns?

In two cases, the AsyncSAXParser thread will not teminate. 
1) There is an exception occures in the SAXXMLStreamReaderImpl
2) The user doesn't parse the document to the end 

To make sure the AsyncSAXParser thread terminates correctly, following modifications are done.
1)  When an exception occurs in the next() method the AsyncSAXParser thread is interrupted, because after that no call to the StreamReader is valid. 
2)  When an exception occures in other methods of StreamReader, a call to StreamReader may still be valid, so the AsyncSAXParser thread shouldn't be interrupted in this case. 
3) In the close() method, if the AsyncSAXParser thread is still alive, interrupt it.
But if the user doesn't close the StreamReader after using it, the AsyncSAXParser thread may never terminate. So user should call the close() method. 


>In the fix that you made in SAXXMLStreamReader.initialElementAttrs() you
>added a check for duplicate attributes that I didn't understand. A SAX
>parser already does this well-formedness check. Is there a reason for
>doing that again in the XMLStreamReader?

The SAX parser cann't recognize the element such as  "<root xmlns:a='xxx' xmlns:b='xxx' a:attr='1' b:attr='2' />", so I  check it myself. 



> Error getting prefix for an attribute with no namespace
> -------------------------------------------------------
>
>                 Key: XERCESJ-1178
>                 URL: http://issues.apache.org/jira/browse/XERCESJ-1178
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: StAX
>    Affects Versions: 2.8.0
>            Reporter: Lucian Holland
>         Assigned To: Michael Glavassevich
>         Attachments: stax_patch_8.19.zip, stax_patch_8.20.zip
>
>
> The initialElementAttrs()  method of SAXXMLStreamReader sets the prefix of attributes to null if it finds no colon in the attribute name; the problem with this is that getAttributeNamespace() uses this prefix when looking up the namespace uri with a call to getNamespaceURI on the NamespaceContextImpl, and this method throws an IllegalArgumentException if null is passed in. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Commented: (XERCESJ-1178) Error getting prefix for an attribute with no namespace

Posted by "Michael Glavassevich (JIRA)" <xe...@xml.apache.org>.
    [ http://issues.apache.org/jira/browse/XERCESJ-1178?page=comments#action_12428316 ] 
            
Michael Glavassevich commented on XERCESJ-1178:
-----------------------------------------------

The default namespace never applies to attributes.  The case that I'm referring to occurs when an attribute (which has a local name and namespace) is added to the infoset by some processing step after parsing like schema validation or XInclude.  These attributes have no prefix and there may not even be any prefixes bound to the attribute's namespace in the current scope.

> Error getting prefix for an attribute with no namespace
> -------------------------------------------------------
>
>                 Key: XERCESJ-1178
>                 URL: http://issues.apache.org/jira/browse/XERCESJ-1178
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: StAX
>    Affects Versions: 2.8.0
>            Reporter: Lucian Holland
>
> The initialElementAttrs()  method of SAXXMLStreamReader sets the prefix of attributes to null if it finds no colon in the attribute name; the problem with this is that getAttributeNamespace() uses this prefix when looking up the namespace uri with a call to getNamespaceURI on the NamespaceContextImpl, and this method throws an IllegalArgumentException if null is passed in. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Commented: (XERCESJ-1178) Error getting prefix for an attribute with no namespace

Posted by "hua lei (JIRA)" <xe...@xml.apache.org>.
    [ http://issues.apache.org/jira/browse/XERCESJ-1178?page=comments#action_12428311 ] 
            
hua lei commented on XERCESJ-1178:
----------------------------------

I'm not sure in which case an attribute will have a default namespace. It seems that such case is impossible from W3C Namespaces in XML 1.1 (http://www.w3.org/TR/xml-names11/).

> Error getting prefix for an attribute with no namespace
> -------------------------------------------------------
>
>                 Key: XERCESJ-1178
>                 URL: http://issues.apache.org/jira/browse/XERCESJ-1178
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: StAX
>    Affects Versions: 2.8.0
>            Reporter: Lucian Holland
>
> The initialElementAttrs()  method of SAXXMLStreamReader sets the prefix of attributes to null if it finds no colon in the attribute name; the problem with this is that getAttributeNamespace() uses this prefix when looking up the namespace uri with a call to getNamespaceURI on the NamespaceContextImpl, and this method throws an IllegalArgumentException if null is passed in. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Commented: (XERCESJ-1178) Error getting prefix for an attribute with no namespace

Posted by "Lucian Holland (JIRA)" <xe...@xml.apache.org>.
    [ http://issues.apache.org/jira/browse/XERCESJ-1178?page=comments#action_12438578 ] 
            
Lucian Holland commented on XERCESJ-1178:
-----------------------------------------

Seems to work fine for me now. Thanks!

> Error getting prefix for an attribute with no namespace
> -------------------------------------------------------
>
>                 Key: XERCESJ-1178
>                 URL: http://issues.apache.org/jira/browse/XERCESJ-1178
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: StAX
>    Affects Versions: 2.8.0
>            Reporter: Lucian Holland
>         Assigned To: Michael Glavassevich
>         Attachments: stax_patch_8.19.zip, stax_patch_8.20.zip, stax_patch_8.23.zip
>
>
> The initialElementAttrs()  method of SAXXMLStreamReader sets the prefix of attributes to null if it finds no colon in the attribute name; the problem with this is that getAttributeNamespace() uses this prefix when looking up the namespace uri with a call to getNamespaceURI on the NamespaceContextImpl, and this method throws an IllegalArgumentException if null is passed in. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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


[jira] Commented: (XERCESJ-1178) Error getting prefix for an attribute with no namespace

Posted by "Michael Glavassevich (JIRA)" <xe...@xml.apache.org>.
    [ http://issues.apache.org/jira/browse/XERCESJ-1178?page=comments#action_12428306 ] 
            
Michael Glavassevich commented on XERCESJ-1178:
-----------------------------------------------

>From a post I made on on j-dev list on 08/14/2006:

In my opinion we should be storing the element and attribute namespace URIs from the SAX events and returning them instead of looking them up from the namespace context. This isn't just for performance reasons. It's possible that an attribute reported by the SAX parser may have a namespace but no prefix (for instance if it was defaulted from an XML schema). In such a case the namespace context look-up won't even work.

> Error getting prefix for an attribute with no namespace
> -------------------------------------------------------
>
>                 Key: XERCESJ-1178
>                 URL: http://issues.apache.org/jira/browse/XERCESJ-1178
>             Project: Xerces2-J
>          Issue Type: Bug
>          Components: StAX
>    Affects Versions: 2.8.0
>            Reporter: Lucian Holland
>
> The initialElementAttrs()  method of SAXXMLStreamReader sets the prefix of attributes to null if it finds no colon in the attribute name; the problem with this is that getAttributeNamespace() uses this prefix when looking up the namespace uri with a call to getNamespaceURI on the NamespaceContextImpl, and this method throws an IllegalArgumentException if null is passed in. 

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

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