Reserved words in Spry

ColdFusion, Spry Add comments

A collegue of mine was making his first exploits with Spry and ran into an interesting problem. Given an XML packet like;



john
frank
al

Using tools like Cooktop xpath searches like //bar and //bar[@parentid=1] returns exactly what you’d expect but no matter what we tried we couldn’t get this to work as part of a Spry xpath statement.

I asked Ray if he may know - we knew the xpath syntax was right but Spry wasn’t play nice. He promptly went off and a few hours later sent me a link to Spry Tester - what a guy! Later on I caught up with Sean and he offered the exact same xpath syntax so I knew we must be on the right path…to cut a long story short we’d posted to the Spry Forums and Kin from Adobe responded that the google xpath library that Spry uses doesn’t like the word ‘parent’ in it. Playing around it also seems like it doesn’t like the word ‘child’ either - so just be careful how you name your xml nodes/attributes and subsequently search your xml with xpath if you’re using Spry!

One Response to “Reserved words in Spry”

  1. Raymond Camden Says:

    Now _that_ is weird. Thanks for posting this.

Leave a Reply

WP Theme & Icons by N.Design Studio
Entries RSS Comments RSS Log in