[Zope] How to use ParsedXML

Chris Withers chris at simplistix.co.uk
Wed May 25 16:05:09 EDT 2005


Jason Leach wrote:
> hi,
> 
> If I have a ParsedXML document with the following:
> 
> <?xml version="1.0"?>
> <faq title="A Sample FAQ">
>   <entry>
>     <question>To be or not to be?</question>
>     <answer>That is the question.</answer>
>    </entry>
>    <entry>
>     <question>The question of life
>     the universe and everything?</question>
>     <answer>42</answer>
>    </entry>
> </faq>
> 
> 
> <p tal:content="here/myxmldoc/entry/question"></p>

Try:
<p 
tal:content="here/myxmldoc/faq/0/entry/0/question/nodeValue/question"></p>

Or some such... I remember reading docs for this so you'll have to have 
a look or resort to DOM-based traversal like I did ;-)

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk



More information about the Zope mailing list