xsl-list
[Top] [All Lists]

RE: Some help with xsl transform and filter please

2004-03-25 10:57:15
Okay that almost got me there.  now what would I do to show each member of that 
struct? 

2. what books or tutorials diagram this stuff I cant seem to really get a grasp 
from the somewhat limited examples on xml101.com.

-----Original Message-----
From: Ben Gazzard <BenG(_at_)tequila-uk(_dot_)com>
Sent: Mar 25, 2004 9:53 AM
To: "'xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com'" 
<xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com>
Subject: RE: [xsl] Some help with xsl transform and filter please

you had two </xsl:for-each> s

so maybe...?

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
<xsl:template match="/">
        <xsl:for-each select="//string[string()='Syndicated']">
                <xsl:value-of select="../../name" />
                :
                <xsl:value-of select="." />
                ;<br />
        </xsl:for-each>
</xsl:template>
</xsl:stylesheet>

Hope this helps...

Ben Gazzard

-----Original Message-----
From: Dylan Barber [mailto:dylan(_dot_)barber(_at_)earthlink(_dot_)net]
Sent: 25 March 2004 17:33
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Some help with xsl transform and filter please


Okay hope I am not asking something so basic everyone thinks I am a dunce
but i have an xml document that comes from a web service like this

  <?xml version="1.0" encoding="iso-8859-1" ?> 
           <methodResponse>
                <params>
                       <param>
                            <value>
                                <array>
                                    <data>
                                         <value>
                                              <struct>
                                                 <member>
                                                      <name>feedid</name> 
                                                      <value>
 
<string>2403</string> 
                                                      </value>
                                                 </member>
                                                 <member>
                                                      <name>status</name> 
                                                      <value>
 
<string>Syndicated</string> 
                                                      </value>
                                                 </member>
                                              </struct>
                                        </value>
                                  </data>
                             </array>
                       </value>
                 </param>
            </params>
  </methodResponse>

I have tried to transform it with something like this 

<xsl:template match="/">
        <xsl:for-each select="struct/member/value[string='Syndicated']">
                <xsl:value-of select="name" />
                :
                <xsl:value-of select="string" />
                ;<br />
                </xsl:for-each>
        </xsl:for-each>
</xsl:template>

but this doesnt seem to work.  I am a newbie with this whole thing and
really need some guidance on how this whole xsl xml thing goes together.
Sorry if I have missed the obvious or broken any rules.

Dylan Barber (CIW Professional, A+ Technician, Web Designer, Web Developer)

home phone-:- (785) 765-2664
work phone-:- (785) 539-3565 x1034
email-:- dylan(_dot_)barber(_at_)earthlink(_dot_)net
homesite-:- http://www.codegalaxy.com


--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
You are subscribed as: BenG(_at_)tequila-uk(_dot_)com
To unsubscribe, go to:
http://lists.mulberrytech.com/unsub.php/xsl-list/BenG(_at_)tequila-uk(_dot_)com
or e-mail:
<mailto:xsl-list-unsubscribe-BenG=tequila-uk(_dot_)com(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--

This e-mail and any attached files are for the exclusive use of the addressee 
and may contain privileged and/or confidential information. If you receive this 
e-mail in error you should not disclose the contents to any other person nor 
take copies but should delete it and telephone us immediately on +44(0)20 7557 
6100.

Tequila London Limited does not make any warranty as to the accuracy or 
completeness of this e-mail and we accept no liability for its content or use. 
Any opinions expressed in this e-mail are those of the author and do not 
necessarily reflect the opinions of Tequila London Limited.

Tequila London Limited operates within the parameters set by the Data 
Protection Act 1998 with regard to the use of personal information including 
e-mail addresses. We accept no liability for the forwarding of this e-mail to 
other parties that may result in unsolicited e-mails being received by those 
whose email addresses appear in this e-mail.

--+------------------------------------------------------------------
XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list
You are subscribed as: dylan(_dot_)barber(_at_)earthlink(_dot_)net
To unsubscribe, go to: 
http://lists.mulberrytech.com/unsub.php/xsl-list/dylan(_dot_)barber(_at_)earthlink(_dot_)net
or e-mail: 
<mailto:xsl-list-unsubscribe-dylan(_dot_)barber=earthlink(_dot_)net(_at_)lists(_dot_)mulberrytech(_dot_)com>
--+--



Dylan Barber (CIW Professional, A+ Technician, Web Designer, Web Developer)

home phone-:- (785) 765-2664
work phone-:- (785) 539-3565 x1034
email-:- dylan(_dot_)barber(_at_)earthlink(_dot_)net
homesite-:- http://www.codegalaxy.com