The reason for not retrieving the textual qname has perfromance reasons. If not necessary it is not done.
According to my understanding the behavior is correct.
see ContentHandler API for
public void startElement (String uri, String localName,
String qName, Attributes atts)
throws SAXException;
There is reads as follows:
* @param qName the qualified name (with prefix), or the
* empty string if qualified names are not available
Please let me know whether you can set the option in SAXON or you believe EXIficient's beahvior is not correct.
Anyhow, I will think about reporting the qname always. I need to consider how much penalty it would be.
Daniel
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Anonymous
-
2012-09-24
Hi Daniel,
Thanks for your answer.
For what I understand, EXIFicient code seems OK.
But I notice that the traditionnal way is to provide the QName even
when http://xml.org/sax/features/namespace-prefixes is set to false.
Xerces works like that and Saxon wants a parser that reports QName
(and forces the "namespace-prefixes" option to false before parsing).
To make EXIficent work with Saxon I have built EXIFicient with only one modified class. I change the class SAXdecoder around lines 341, 470 and 550 to report QNames. Anyway, good to hear that you may plan to include qname report in a future version ! - Vincent
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I'm currently trying to integrate EXIficient with Saxon. I build saxon XDMNode from EXISource.
I noticed that in your code (SAXDecoder.java 467-470), you choose to hide the QName when the namespace-prefixes property is set to false.
Saxon requires an XML parser that reports the QName. If not, it throws an exception.
To ease saxon integration, is it possible to update the code to meet saxon requirement ?
Thanks,
Vincent Biragnet
Hi Vincent,
The reason for not retrieving the textual qname has perfromance reasons. If not necessary it is not done.
According to my understanding the behavior is correct.
see ContentHandler API for
public void startElement (String uri, String localName,
String qName, Attributes atts)
throws SAXException;
There is reads as follows:
* @param qName the qualified name (with prefix), or the
* empty string if qualified names are not available
If the SAXDecoder is not set http://xml.org/sax/features/namespace-prefixes == true no qnames as strings are reported.
Please let me know whether you can set the option in SAXON or you believe EXIficient's beahvior is not correct.
Anyhow, I will think about reporting the qname always. I need to consider how much penalty it would be.
Hi Daniel,
Thanks for your answer.
For what I understand, EXIFicient code seems OK.
But I notice that the traditionnal way is to provide the QName even
when http://xml.org/sax/features/namespace-prefixes is set to false.
Xerces works like that and Saxon wants a parser that reports QName
(and forces the "namespace-prefixes" option to false before parsing).
To make EXIficent work with Saxon I have built EXIFicient with only one modified class. I change the class SAXdecoder around lines 341, 470 and 550 to report QNames. Anyway, good to hear that you may plan to include qname report in a future version ! - Vincent
Hi Vincent,
Like you suggested I decided to switch on qname reporting in any case.
The next release and starting from SVN Revision 413 include this code update.