A little more info.  If I construct an GDataXMLElement using a string
(initWithXMLString:error) I can successfully upload to GoogleHealth.
If I construct the same element using the addChild message it is
rejected.

Here are the two elements when logging using the description of the
element.  Although they appear to be the same according to the
isEqualToString method they are not equal.

2011-01-22 11:24:48.115 DocTag[53096:207] GDataXMLElement 0x10b79db0:
{type:1 name:ContinuityOfCareRecord xml:"<ContinuityOfCareRecord
xmlns="urn:astm-
org:CCR"><Body><Medications><Medication><Product><ProductName><Text>TestMed</
Text></ProductName></Product></Medication></Medications></Body></
ContinuityOfCareRecord>"}

2011-01-22 11:24:48.121 DocTag[53096:207] GDataXMLElement 0x10b7ae00:
{type:1 name:ContinuityOfCareRecord xml:"<ContinuityOfCareRecord
xmlns="urn:astm-
org:CCR"><Body><Medications><Medication><Product><ProductName><Text>TestMed</
Text></ProductName></Product></Medication></Medications></Body></
ContinuityOfCareRecord>"}

Here is the code used to construct each element:

initWithXMLString code
----------------------------------------------------
NSString* pstring = @"<ContinuityOfCareRecord xmlns=\"urn:astm-org:CCR
\"><Body><Medications><Medication><Product><ProductName><Text>TestMed</
Text></ProductName></Product></Medication></Medications></Body></
ContinuityOfCareRecord>";

GDataXMLElement* root = [GDataXMLNode alloc];
[root initWithXMLString:pstring error:nil];
----------------------------------------------------



addChild code
----------------------------------------------------
        //Create root xml element
        GDataXMLElement* root = [GDataXMLElement
elementWithName:@"ContinuityOfCareRecord"];
        GDataXMLNode* attribute = [GDataXMLNode attributeWithName:@"xmlns"
stringValue:@"urn:astm-org:CCR"];
        [root addAttribute:attribute];

        //Create body branch child elements
        GDataXMLElement* body =  [GDataXMLNode elementWithName:@"Body"];
        GDataXMLElement* medications = [GDataXMLNode
elementWithName:@"Medications"];
        GDataXMLElement* medication = [GDataXMLNode
elementWithName:@"Medication"];
        GDataXMLElement* product = [GDataXMLNode elementWithName:@"Product"];
        GDataXMLElement* productname = [GDataXMLNode
elementWithName:@"ProductName"];
        GDataXMLElement* text = [GDataXMLNode elementWithName:@"Text"
stringValue:@"TestMed"];

        //Add children to body branches
        [productname addChild:text];
        [product addChild:productname];
        [medication addChild:product];
        [medications addChild:medication];
        [body addChild:medications];

        //Add branches to root
        [root addChild:body];

----------------------------------------------------

Thanks in advance,
DT





On Jan 21, 4:40 pm, "Paul (Google)" <[email protected]> wrote:
> It definitely would be helpful to see the XML (Atom+CCR) that's being posted
> by the code.  Is it possible to capture it somehow before it's sent to the
> service?
>
> Paul

-- 
You received this message because you are subscribed to the Google Groups 
"Google Health Developers" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/googlehealthdevelopers?hl=en.

Reply via email to