I dont know why specifying the namespace causes it to fail on android
String base = atts.getValue("http://www.w3.org/XML/1998/
namespace",
"xml:base");

with the second method of getting the parser fails.


On Apr 8, 6:50 pm, Anil <[EMAIL PROTECTED]> wrote:
> wow, that worked. thanks much!
>
> On Apr 8, 6:46 pm, "Dan U." <[EMAIL PROTECTED]> wrote:
>
> > I think the problem is with your first example of getting the parser.
> > Try the second one.
>
> > On Apr 8, 4:20 pm, Anil <[EMAIL PROTECTED]> wrote:
>
> > > Hi Dan,
> > > I tried your solution. Unfortunately it didn't work.
> > > String base = atts.getValue("",    "xml:base");
> > > Dont know why it can get the href value, but not the base.
> > > thanks,
> > > Anil
>
> > > On Apr 8, 5:55 pm, "Dan U." <[EMAIL PROTECTED]> wrote:
>
> > > > Well, I can't give you an explanation at this time, but if you do
> > > > String base = atts.getValue("", "xml:base");, it should work.
>
> > > > On Apr 8, 2:33 pm, Anil <[EMAIL PROTECTED]> wrote:
>
> > > > > This works fine in j2se, but am stumped why it fails in android.
> > > > > Cannot get attribute "base" from XMLReader (SAX). It is always null.
> > > > > Any help appreciated.
> > > > > thanks,
> > > > > Anil
>
> > > > > schema:
> > > > > -----------
> > > > > <xs:complexType name="RelativeURI">
> > > > >         <xs:simpleContent>
> > > > >                 <xs:extension base="xs:anyURI">
> > > > >                         <xs:attribute ref="xml:base"/>
> > > > >                         <xs:attribute name="href" type="xs:string"/>
> > > > >                 </xs:extension>
> > > > >         </xs:simpleContent>
> > > > > </xs:complexType>
>
> > > > > <xs:element name="imgLocation" type="RelativeURI" minOccurs="0"
> > > > > maxOccurs="1"/>
>
> > > > > data:
> > > > > -------
> > > > > <imgLocation xml:base="file:/data/data/com.jo.blockpad/files/jo-
> > > > > files/" href="hasaudio.jpg"/>
>
> > > > > allocating parser:
> > > > > -------------------------
> > > > > System.setProperty("org.xml.sax.driver","org.xmlpull.v1.sax2.Driver");
> > > > > parser = XMLReaderFactory.createXMLReader();
>
> > > > > *OR*
>
> > > > >        SAXParserFactory spf = SAXParserFactory.newInstance();
> > > > >        SAXParser sp;
> > > > >         sp = spf.newSAXParser();
> > > > >        // Get the XMLReader of the SAXParser we created.
> > > > >         parser = sp.getXMLReader();
>
> > > > > trying to retrieve the attribute, *base is always null*
>
> > > > > String base = atts.getValue("http://www.w3.org/XML/1998/
> > > > > namespace",                                                
> > > > > "xml:base");
>
> > > > > *OR*
>
> > > > > String base = atts.getValue("",       "base");
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
[EMAIL PROTECTED]
Announcing the new M5 SDK!
http://android-developers.blogspot.com/2008/02/android-sdk-m5-rc14-now-available.html
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to