Archived Forum Post

Index of archived forum posts


vfp, atom nested tag not working .

Mar 28 '13 at 05:50

c_file = "d:/..."
o_atom = CreateObject('Chilkat.atom')
n_success = o_atom.LoadXml(c_file)
IF (n_success <> 1) THEN

*? o_atom.toXmlString()
o_entry = o_atom.getEntry(0)
? "gd:etag=",o_entry.getTopAttr("gd:etag") && ok
? "id1=",o_entry.getElement("id",0) && ok
? "id2=",o_entry.getElement("id",1) && ok, null
? "title1=",o_entry.getElement("title",0) && ok

? "gd:name=",o_entry.getElement("gd:name",0) && error -> null
? "gd:fullname=",o_entry.getElement("gd:fullName",0) && error -> null

? "gd:extendedProperty=",o_entry.getElementAttr("gd:extendedProperty",0,"name") && ok
? "gd:extendedProperty=",o_entry.getElementAttr("gd:extendedProperty",0,"value") && ok

? "getElementCount=",o_entry.getElementCount("link") && ok
? "getLinkHref=",o_entry.getLinkHref("self") && ok
? "getLinkHref=",o_entry.getLinkHref("") && ok

wait window " ok atom created"
release o_atom


The problem has to do with the fact that "gd:name" has no actual content as defined by the Chilkat XML API. See

The "gd:name" node has one child node -- namely "gd:fullName", and it in turn has the content "Fitzwilliam Darcy".

    <entry gd:etag="contactEtag">
        <app:edited xmlns:app="">2008-12-10T04:45:03.331Z</app:edited>
        <category scheme="" term="" />
        <title>Fitzwilliam Darcy</title>
            <gd:fullName>Fitzwilliam Darcy</gd:fullName>

If the "gd:name" node specified a type of "xml", then the getElement("gd:name") method call would return the full XML contained within it.

For example:

        <gd:name type="xml">
            <gd:fullName>Fitzwilliam Darcy</gd:fullName>

If the Chilkat Atom API does not provide a means to directly access the XML content, then you may instead use the Chlikat XML API directly for parsing the XML.


What do you mean by "not working". We cannot read your mind...


<gd:name> <gd:fullname> Darcy </gd:fullname> </gd:name>

? o_entry.getElement("gd:Name",0)
i expect " <gd:fullname> Darcy </gd:fullname>"
but the result is empty(not null)
? o_entry.getElement("gd:fullName",0)
i expect "Darcy"
but the result is empty(not null)

when i change sample as
<gd:name> Darcy </gd:name>

then it is ok, returns Darcy