On Tue, Sep 14, 2010 at 11:42 AM, Charlie Francis < [email protected]> wrote:
> Sorry George, I don't think I've explained myself thoroughly. > > I am looking to extract the story structure that contains the id of my > choice. So I would load the whole XML into the composition and then filter > the stories on the id I select, so that I can use the data inside that part > of the structure. > So if I filtered it with the string 'default' it would only select story:1 > from the XML structure. > > I hope that clears it up. > > Charlie, > > Your xml has two items that have "default" associated with them as siblings, so you don't have unique id's. I guess that, in my mind, I can conceive of how to filter based on a specific term, if it was the parent, or a combo of a parent term (such as the "story:x" that is generated by your structure) and an associated sibling making a kind of pass fail, but at best that would still leave two items that pass the test of being a "story" and having "default" present given your structure. So, I'm not sure what the desired outcome would be if two results meet the criteria. I suspect that an element of this is going over my head. Sorry for being thick on this one! Best, George Toledo > On 14 September 2010 16:22, George Toledo <[email protected]> wrote: > >> When one creates an xml file like you have in your sample, each "<story>" >> entry, when loaded with the XML Importer, will load as "story:0", "story:1", >> and so on, because they all have the same key name. >> >> So, you can "get" that part of the structure by using a structure key >> member with "story:0" in the Key input. >> >> Then, to render the 3 other elements by using an iterator and iterator >> variables, and an interpolation patch to place them. See exhibit 1. >> >> Further, if you wish for the word "default" to not render, one can use >> string compare, with the word "default" as the second term to keep the >> Billboard from rendering this term. See exhibit 2. >> >> If you wish to rotate through your "stories" you can make a string >> multiplexer, fill it with your "key" terms to search, and push through the >> list. See exhibit 3. >> >> You could use other string patches to make certain words render or not >> render in ways similar to what I've setup here, or use Logic patch to make >> it so that certain combos of words are needed to make something render. >> >> You can also use things like String truncate, replace, or printer to add >> in phrases, which can be useful. >> >> -George Toledo >> >> On Tue, Sep 14, 2010 at 10:21 AM, Charlie Francis < >> [email protected]> wrote: >> >>> Hi, >>> >>> I haven't looked too far into this but thought I'd ask anyway as you guys >>> seem to be very knowledgable! >>> >>> <root> >>> <id>home</id> >>> <title>Home Page</title> >>> <story> >>> <id>default</id> >>> <title>Welcome</title> >>> <content>We welcome you to the site</content> >>> </story> >>> <story> >>> <id>sale</id> >>> <title>Buy</title> >>> <content>Here is some stuff to buy</content> >>> </story> >>> <story> >>> <id>default</id> >>> <title>News</title> >>> <content>The best place for news</content> >>> </story> >>> </story> >>> >>> I've got an XML sheet that I want to search through for a specific >>> key,value pair and select that part of the structure to output. >>> >>> So for instance with the above XML I want to select only the story >>> element with the id of default and then be able to use it's sibling elements >>> title (Welcome) and content (We welcome you to the site). Is it possible to >>> do this with the built in XML and Structure patches, or will I have to >>> create some form of Javascript Patch to search through and then select the >>> correct story element. >>> >>> If there is a better way of doing this I would like to know, as I'm >>> completely open to new and better ways of solving problems! >>> >>> Thanks, >>> Charlie >>> >>> _______________________________________________ >>> Do not post admin requests to the list. They will be ignored. >>> Quartzcomposer-dev mailing list ([email protected] >>> ) >>> Help/Unsubscribe/Update your Subscription: >>> >>> http://lists.apple.com/mailman/options/quartzcomposer-dev/gtoledo3%40gmail.com >>> >>> This email sent to [email protected] >>> >> >> >
_______________________________________________ Do not post admin requests to the list. They will be ignored. Quartzcomposer-dev mailing list ([email protected]) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com This email sent to [email protected]

