Re: jdom-interest Digest, Vol 56, Issue 13

"S. Seide" <[email protected]>
Newsgroups gmane.comp.java.jdom.general
Message-ID <[email protected]>
> But http://xml.org/sax/features/namespace-prefixes is set to true in
> SAXBuilder (along with http://xml.org/sax/features/namespaces), so my
> understanding is getQName() should never be "".  If its a unprefixed
> name, then getQName() should be returning the same as getLocalName().
> In this case "version".
> 
> I can't remember, can you turn either of those SAX features off in SAXBuilder?

turning them off givs the following results (application specific part
of stack removed for better readability):

SAXBuilder parser = new SAXBuilder();
parser.setFeature("http://xml.org/sax/features/namespace-prefix", false);
Document doc = parser.build(is);

atts.getLocalName(i) - "version"
atts.getQName(i) - ""

> 07-30 13:04:49.965: ERROR/Global(844): java.lang.StringIndexOutOfBoundsException
> 07-30 13:04:49.965: ERROR/Global(844):     at java.lang.String.substring(String.java:1571)
> 07-30 13:04:49.965: ERROR/Global(844):     at org.jdom.input.SAXHandler.startElement(SAXHandler.java:568)
> 07-30 13:04:49.965: ERROR/Global(844):     at org.apache.harmony.xml.ExpatParser.startElement(ExpatParser.java:145)
> 07-30 13:04:49.965: ERROR/Global(844):     at org.apache.harmony.xml.ExpatParser.append(Native Method)
> 07-30 13:04:49.965: ERROR/Global(844):     at org.apache.harmony.xml.ExpatParser.parseFragment(ExpatParser.java:506)
> 07-30 13:04:49.965: ERROR/Global(844):     at org.apache.harmony.xml.ExpatParser.parseDocument(ExpatParser.java:467)
> 07-30 13:04:49.965: ERROR/Global(844):     at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:329)
> 07-30 13:04:49.965: ERROR/Global(844):     at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:286)
> 07-30 13:04:49.965: ERROR/Global(844):     at org.jdom.input.SAXBuilder.build(SAXBuilder.java:518)
> 07-30 13:04:49.965: ERROR/Global(844):     at org.jdom.input.SAXBuilder.build(SAXBuilder.java:865)
...
> 07-30 13:04:49.965: ERROR/Global(844):     at dalvik.system.NativeStart.main(Native Method)

===

SAXBuilder parser = new SAXBuilder();
parser.setFeature("http://xml.org/sax/features/namespaces", false);
Document doc = parser.build(is);

> 07-30 13:09:58.367: ERROR/Global(898): org.jdom.input.JDOMParseException: Error in building: The 'namespace-prefix' feature is not supported while the 'namespaces' feature is enabled.: The 'namespace-prefix' feature is not supported while the 'namespaces' feature is enabled.
> 07-30 13:09:58.367: ERROR/Global(898):     at org.jdom.input.SAXBuilder.build(SAXBuilder.java:538)
> 07-30 13:09:58.367: ERROR/Global(898):     at org.jdom.input.SAXBuilder.build(SAXBuilder.java:865)
...
> 07-30 13:09:58.367: ERROR/Global(898):     at dalvik.system.NativeStart.main(Native Method)
> 07-30 13:09:58.367: ERROR/Global(898): Caused by: org.xml.sax.SAXNotSupportedException: The 'namespace-prefix' feature is not supported while the 'namespaces' feature is enabled.
> 07-30 13:09:58.367: ERROR/Global(898):     at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:264)
> 07-30 13:09:58.367: ERROR/Global(898):     at org.jdom.input.SAXBuilder.build(SAXBuilder.java:518)
> 07-30 13:09:58.367: ERROR/Global(898):     ... 18 more
> 07-30 13:09:58.367: ERROR/Global(898): Caused by: org.xml.sax.SAXNotSupportedException: The 'namespace-prefix' feature is not supported while the 'namespaces' feature is enabled.
> 07-30 13:09:58.367: ERROR/Global(898):     at org.apache.harmony.xml.ExpatReader.parse(ExpatReader.java:264)
> 07-30 13:09:58.367: ERROR/Global(898):     at org.jdom.input.SAXBuilder.build(SAXBuilder.java:518)
> 07-30 13:09:58.367: ERROR/Global(898):     at org.jdom.input.SAXBuilder.build(SAXBuilder.java:865)
...
> 07-30 13:09:58.367: ERROR/Global(898):     at dalvik.system.NativeStart.main(Native Method)

===

SAXBuilder parser = new SAXBuilder();
parser.setFeature("http://xml.org/sax/features/namespaces", false);
parser.setFeature("http://xml.org/sax/features/namespace-prefix", false);
Document doc = parser.build(is);

> 07-30 13:13:21.586: ERROR/Global(935): org.jdom.JDOMException: http://xml.org/sax/features/namespace-prefix feature not recognized for SAX driver org.apache.harmony.xml.ExpatReader
> 07-30 13:13:21.586: ERROR/Global(935):     at org.jdom.input.SAXBuilder.internalSetFeature(SAXBuilder.java:827)
> 07-30 13:13:21.586: ERROR/Global(935):     at org.jdom.input.SAXBuilder.setFeaturesAndProperties(SAXBuilder.java:766)
> 07-30 13:13:21.586: ERROR/Global(935):     at org.jdom.input.SAXBuilder.createParser(SAXBuilder.java:621)
> 07-30 13:13:21.586: ERROR/Global(935):     at org.jdom.input.SAXBuilder.build(SAXBuilder.java:489)
> 07-30 13:13:21.586: ERROR/Global(935):     at org.jdom.input.SAXBuilder.build(SAXBuilder.java:865)
...
> 07-30 13:13:21.586: ERROR/Global(935):     at dalvik.system.NativeStart.main(Native Method)


regards,
S. Seide
_______________________________________________
To control your jdom-interest membership:
http://www.jdom.org/mailman/options/jdom-interest/[email protected]
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.