Re: [Hypercontent-users] XML/XSL Include
Brought to you by:
alexvigdor
From: Alex V. <av...@co...> - 2006-04-24 13:39:55
|
Hi Carl, What about something like this: <xsl:apply-templates select="/cms:wrapper/cms:include/page/bodytext" /> <xsl:template match="bodytext"> <xsl:value-of select="@firstname"/> <xsl:value-of select="@lastname"/> <xsl:value-of select="@email"/> </xsl:template> You'll of course need to make sure that your include has the attribute data="yes". Cheers, Alex On Apr 24, 2006, at 8:22 AM, Carl Barrow wrote: > Hi Alex, > > On one of the sites here in Hull I have a file for each member of > staff with the following dtd to define it: > > <!ELEMENT page (rightbox*,bodytext,leftbox?)> > <!ELEMENT rightbox (html)> > <!ELEMENT bodytext > (photo,qualifications,researchinterests,researchcategories,biography,m > odulestaught,memberships,publications)> > <!ELEMENT photo (html)> > <!ELEMENT qualifications (html)> > <!ELEMENT researchinterests (html)> > <!ELEMENT researchcategories (html)> > <!ELEMENT biography (html)> > <!ELEMENT modulestaught (html)> > <!ELEMENT memberships (html)> > <!ELEMENT publications (html)> > <!ELEMENT leftbox (html)> > <!ATTLIST rightbox title CDATA #REQUIRED> > <!ATTLIST leftbox title CDATA #REQUIRED> <!ATTLIST bodytext title > CDATA #REQUIRED> > <!ATTLIST bodytext firstname CDATA #REQUIRED> > <!ATTLIST bodytext lastname CDATA #REQUIRED> > <!ATTLIST bodytext academictitle CDATA #REQUIRED> > <!ATTLIST bodytext honorarytitle CDATA #REQUIRED> > <!ATTLIST bodytext extention CDATA #REQUIRED> > <!ATTLIST bodytext roomnumber CDATA #REQUIRED> > <!ATTLIST bodytext email CDATA #REQUIRED> > <!ATTLIST page navigationtitle CDATA #REQUIRED> > > I want to include the firstname, lastname and email for each member > of staff on an index page. At the moment I only seem to be able > to include everything on a staff page The code I have is as follows: > > > <xsl:template name="bodytext"> > <xsl:for-each select="/cms:wrapper/cms:include[@pattern='/people/ > staff/*.xml']"> > <xsl:apply-templates /> > </xsl:for-each> > </xsl:template> > > I though I would be able to use: > <xsl:apply-templates select="/cms:wrapper/cms:source/page/bodytext/ > @firstname" /> > > but that isn't working. Can you see what I'm doing wrong at all? > > Cheers > Carl > > -- > ************************************ > > Carl Barrow > Systems Integrator > e-Services > The University of Hull > Cottingham Road > Hull > HU6 7RX > Ext. 6838 > ************************************ > > ********************************************************************** > ******************* > To view the terms under which this email is distributed, please go > to http://www.hull.ac.uk/legal/email_disclaimer.html > ********************************************************************** > ******************* > > > ------------------------------------------------------- > Using Tomcat but need to do more? Need to support web services, > security? > Get stuff done quickly with pre-integrated technology to make your > job easier > Download IBM WebSphere Application Server v.1.0.1 based on Apache > Geronimo > http://sel.as-us.falkag.net/sel? > cmd=lnk&kid=120709&bid=263057&dat=121642 > _______________________________________________ > Hypercontent-users mailing list > Hyp...@li... > https://lists.sourceforge.net/lists/listinfo/hypercontent-users |