listenheart/xerces-for-android

Cannot read attribute (short tag?)

Opened this issue · 0 comments

What steps will reproduce the problem?
I parse a XML file (RSS) of the form 

<?xml version="1.0" encoding="utf-8" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" 
xmlns:rtl="http://www.rtl.be/rtltvi/dtds/rss-1.0.dtd">
    <channel>
        <item>
            <title>title</title>
            <link>url</link>
            <description></description>
            <pubDate short="04-10-2013">date</pubDate>
            <enclosure url="http://www.dns.com/4212514.jpg" length="0" type="image/jpeg" />

...



XPathExpression<Object> query = 
XPathFactory.instance().compile("/rss/channel/item");
List<Object> lst = query.evaluate(document);
    for(Object o: lst){
        if(o instanceof Element){
            Element current = (Element) o;
                for(Object oo: XPathFactory.instance().compile("./enclosure").evaluate(current)){
                }
}
}
}

If I tried to access to oo, it fails.
If I try to list Attributes, it fails.
If I use the query ./enclosure/@url, it fails

What is the expected output? What do you see instead?
To get the attribute's value

What version of the product are you using? On what operating system?
deport of today (2014 Oct 12)


Please provide any additional information below.
I think about a problem in the short tag handling ( open and close the tag < 
... />)

Original issue reported on code.google.com by Belegkarnil on 12 Oct 2014 at 7:37