I haven't played with XML in ages and JSON seems to be the flavour of the month
these days so I'll include it in the discussion.
I using a Social Media authentication service (Janrain) that returns some data
from whatever social media type the user decides to log in with. It can return
this data as JSON or XML (and possibly others).
An XML return from Facebook looks like this:
<![CDATA[<?xml version='1.0' encoding='UTF-8'?>
<rsp stat='ok'>
<profile>
<providerName>Facebook</providerName>
<identifier>http://www.facebook.com/profile.php?id=6297357315</identifier>
<verifiedEmail>[email protected]</verifiedEmail>
<preferredUsername>WayneIrvine</preferredUsername>
<displayName>Wayne Irvine</displayName>
<name>
<formatted>Wayne Irvine</formatted>
<givenName>Wayne</givenName>
<familyName>Irvine</familyName>
</name>
<email>[email protected]</email>
<url>http://www.facebook.com/wayne.irvine</url>
<photo>https://graph.facebook.com/629357315/picture?type=large</photo>
<utcOffset>10:00</utcOffset>
<address>
<formatted>Sydney, Australia</formatted>
<type>currentLocation</type>
</address>
<birthday>1968-08-23</birthday>
<gender>male</gender>
<providerSpecifier>facebook</providerSpecifier>
</profile>
<limited_data>false</limited_data>
</rsp>]]>
I assign that to a DOM "myDom".
Now I would like to use a specific value within that set, for example, the
<preferredUsername>.
The documentation seems to suggest I should use a structured count like:
<@ELEMENTNAME OBJECT="myDom" XPOINTER="root().child(1).child(4)">
This seems anathema to me as surely the structure should be able to change and
as long as the names remain the same it would return the correct value.
Something like:
<@ELEMENTNAME OBJECT="myDom" CHOSEVALUE="profile.preferredUsername">
Is this not the case?
Wayne Irvine
w: http://www.byteserve.com.au/
p: +61 2 9960 6099
m: 0409 960 609
----------------------------------------
To unsubscribe from this list, please send an email to [email protected]
with "unsubscribe terascript-talk" in the body.