I guess the problem with this is that the output template would need to know
how many instances of child tags there were, in order to display them
properly. In cases like these (when you want to allow your XML document to
be arbitrarily complex) I agree that generating a structure (SOXML-style) is
definitely more useful.

Remember that you can also use XPath to populate your query with only the
elements that you need. That's the way that we're using it in our CMS -
there's a large XML variable containing all the data on the site, and we can
display just the diary thumbnails as follows:

<cfxmlquery 
            xmldata = "c:\path\to\testxml.xml"
            datatype = "file"
            name = "myxmlq3"
            xpath = "//object[@type='diarythumb']">

<cfoutput query = "xmlq">
<img src = "../images/#diarythumb_src#">
</cfoutput>

You can see the output at

http://torchbox.com/diary

I'll post the companion tags soon, which might help to clarify the
appropriate use of this stuff (IMHO!).

Cheers

Tom

P.S. Paul - very much enjoyed your talk on CF documentation at the UK CFUG
last year. We've been writing pseudo-code ever since!

--+

on 27/6/01 9:33 am, Paul Johnston at [EMAIL PROTECTED] wrote:

> There would be an iterator saying how many instances of a tag there are
> within another tag, ie:
> 
> <tag1>
>   <tag2 myattr="aaa">
>   </tag2> <!-- 1 -->
>   <tag2 myattr="bbb">
>   </tag2> <!-- 2 -->
>   <tag2 myattr="bbb">
>   </tag2> <!-- 3 -->
> </tag1>
> 
> Then you could save in the query with unique values like:
> 
> tag2_myattr_1
> tag2_myattr_2
> tag2_myattr_3


-----------------------+
cf-xml mailing list
[EMAIL PROTECTED]
http://torchbox.com/xml

Reply via email to