Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot read attribute (short tag?) #2

Open
GoogleCodeExporter opened this issue Apr 29, 2015 · 0 comments
Open

Cannot read attribute (short tag?) #2

GoogleCodeExporter opened this issue Apr 29, 2015 · 0 comments

Comments

@GoogleCodeExporter
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant