Gau-Yi / google-api-java-client

Automatically exported from code.google.com/p/google-api-java-client
0 stars 0 forks source link

Support default namespace(s) declared in the XML payload of an Atom feed #79

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
External references, such as a standards document, or specification?
http://www.w3.org/TR/REC-xml-names/#scoping-defaulting

Java environments (e.g. Java 6, Android 2.2, App Engine 1.3.7, or All)?
All

Please describe the feature requested.
Default namespaces can be declared in the XML payload of an Atom feed, which 
generally has it's own default namespace.  The following XML is an example of 
how this might look:

<feed xmlns='http://www.w3.org/2005/Atom'>
  <entry>
    <payload xmlns='uri:google:payload'>
      <html xmlns='http://www.w3.org/1999/xhtml'>
        <p>The payload</p>
      </html>
    </payload>
  </entry>
</feed>

Upon parsing an Atom feed with a XML payload with its own default namespace, 
the XmlNamespaceDictionary throws an IllegalArgumentException when it 
encounters the payload element.  Serializing may have similar issues.

Furthermore, it would be ideal for the API to support XML binding/serialization 
to/from GenericXml classes for payload elements with their own default 
namespaces.

Original issue reported on code.google.com by sax...@google.com on 21 Dec 2010 at 2:12

GoogleCodeExporter commented 9 years ago
Thanks for reporting the problem.

We should be able to change our parsing algorithm to be flexible enough to 
handle this case properly.  It shouldn't matter what namespace aliases the 
returned feed uses from the API.  In theory the only thing that matters is the 
namespace URI's.  The only catch is when the namespace alias is not defined in 
the XmlNamespaceDictionary, but that the namespace alias is already used for a 
different namespace URI.  In that case, we should make up a new namespace like 
"ns1", "ns2", etc..  If the developer wants to control the namespace aliases 
(e.g. for serialization), they simply need to declare those namespace 
alias->URI mapping in advance in the XmlNamespaceDictionary.

Original comment by yan...@google.com on 21 Dec 2010 at 12:23

GoogleCodeExporter commented 9 years ago

Original comment by yan...@google.com on 24 Dec 2010 at 1:15

GoogleCodeExporter commented 9 years ago

Original comment by yan...@google.com on 7 Jan 2011 at 3:28

GoogleCodeExporter commented 9 years ago

Original comment by yan...@google.com on 8 Jan 2011 at 6:25

GoogleCodeExporter commented 9 years ago

Original comment by yan...@google.com on 31 Jan 2011 at 9:48

GoogleCodeExporter commented 9 years ago

Original comment by yan...@google.com on 2 Feb 2011 at 5:05

GoogleCodeExporter commented 9 years ago

Original comment by yan...@google.com on 18 Feb 2011 at 1:21

GoogleCodeExporter commented 9 years ago
What Happen is this problem fixed?
I want to use Google api java client to connect android app with Google Health 
Api

Original comment by Alifi...@gmail.com on 9 May 2011 at 7:37

GoogleCodeExporter commented 9 years ago
It should have already been fixed as part of the 1.3 release in February.

Original comment by yan...@google.com on 9 May 2011 at 9:06