xsl-list
[Top] [All Lists]

Can I use <xsl:key>

2005-09-06 00:21:22
Hi,
  I have this xml, 

<root>
<text:p>
       <text:span>
       <text:user-field-get text:name="ce:author">
       au</text:user-field-get>
       </text:span>                 
       <text:span>
       <text:user-field-get text:name="ce:given-name">
       fnm</text:user-field-get>
       </text:span>
       <text:span>Tzou-Chi</text:span>
       <text:span>
       <text:user-field-get text:name="ce:surname">
       snm</text:user-field-get>
       </text:span>
       <text:span>Huang</text:span>
       <text:span>
       <text:user-field-get text:name="/ce:author">
       /au</text:user-field-get>
       </text:span>
</text:p>
<text:p>
       <text:span>
       <text:user-field-get text:name="ce:author">
       au</text:user-field-get>
       </text:span>                 
       <text:span>
       <text:user-field-get text:name="ce:given-name">
       fnm</text:user-field-get>
       </text:span>
       <text:span>Aaron</text:span>
       <text:span>
       <text:user-field-get text:name="ce:surname">
       snm</text:user-field-get>
       </text:span>
       <text:span>Apigo</text:span>
       <text:span>
       <text:user-field-get text:name="ce:e-address">
       ead</text:user-field-get>
       </text:span>
       <text:span>aaron(_at_)yahoo(_dot_)com</text:span>
       <text:span>
       <text:user-field-get text:name="/ce:e-address">
       /ead</text:user-field-get>
       </text:span>
       <text:span>
       <text:user-field-get text:name="/ce:author">
       /au</text:user-field-get>
       </text:span>
</text:p>
<text:p>
       <text:span>
       <text:user-field-get text:name="ce:author">
       au</text:user-field-get>
       </text:span>                 
       <text:span>
       <text:user-field-get text:name="ce:given-name">
       fnm</text:user-field-get>
       </text:span>
       <text:span>Andrew</text:span>
       <text:span>
       <text:user-field-get text:name="ce:surname">
       snm</text:user-field-get>
       </text:span>
       <text:span>Argente</text:span>
       <text:span>
       <text:user-field-get text:name="ce:e-address">
       ead</text:user-field-get>
       </text:span>
       <text:span>andrew(_at_)mail(_dot_)tw</text:span>
       <text:span>
       <text:user-field-get text:name="/ce:e-address">
       /ead</text:user-field-get>
       </text:span>
       <text:span>
       <text:user-field-get text:name="ce:e-address">
       ead</text:user-field-get>
       </text:span>
       <text:span>andrew(_at_)yahoo(_dot_)com</text:span>
       <text:span>
       <text:user-field-get text:name="/ce:e-address">
       /ead</text:user-field-get>
       </text:span>
       <text:span>
       <text:user-field-get text:name="/ce:author">
       /au</text:user-field-get>
       </text:span>
</text:p>
</root>


and I want it to transform like this,

<ce:author-group>
<ce:author>
        <ce:given-name>Tzou-Chi</ce:given-name>
        <ce:surname>Huang</ce:surname>
</ce:author>
<ce:author>
        <ce:given-name>Aaron</ce:given-name>
        <ce:surname>Apigo</ce:surname>
        <ce:e-address>aaron(_at_)yahoo(_dot_)com</ce:e-address>
</ce:author>
<ce:author>
        <ce:given-name>Andrew</ce:given-name>
        <ce:surname>Argente</ce:surname>
        <ce:e-address>andrew(_at_)mail(_dot_)tw</ce:e-address>
        <ce:e-address>andrew(_at_)yahoo(_dot_)com</ce:e-address>
</ce:author>
</ce:author-group>

before I'm trying to use <xsl:for-each> but I have a
problem, i don't know how to terminate it when the
condition was match, but when someone reply in my
topic in this forum about "Terminate <xsl:for-each>",
i got an idea to use it again in other transformation
like the one posted in here.
should I use <xsl:key> or can someone give me an idea
on this?

thanks in advance.

regards.
aaron








        
                
______________________________________________________
Click here to donate to the Hurricane Katrina relief effort.
http://store.yahoo.com/redcross-donate3/

--~------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
To unsubscribe, go to: http://lists.mulberrytech.com/xsl-list/
or e-mail: <mailto:xsl-list-unsubscribe(_at_)lists(_dot_)mulberrytech(_dot_)com>
--~--



<Prev in Thread] Current Thread [Next in Thread>