Subject: [xsl] Avoiding selection of UNREQUESTED elements? From: Simon Knee <skn@xxxxxxxxxxxxxxxx> Date: Thu, 28 Jun 2001 10:04:55 +0100 |
Hello can anyone help me with a simple problem, i think!! I am trying to select log data from this xml snippet: <?xml version="1.0" encoding="utf-8"?> <!DOCTYPE clientlog SYSTEM "/D:/TopLogicXMLXSL/chapter.dtd"> <clientlog> <customer customerid ="bloggs"> <logitem logid ="4321"> <title> baaaaad news </title> <message> test</message> <bpsalesteam>1</bpsalesteam> <bptechnical>bob, billy</bptechnical> <externalother> sally, sue</externalother> <externaltechnical>mik, mikeee</externaltechnical> <contact contactname ="frank spencer" contacttel ="23345" contactmobile ="6778" contactemail ="nelly@hotmail"/> <logtype>tyh</logtype> <date>24/06/01 </date> <followupaction> <priority> high</priority> <followupdetails> help me </followupdetails> <nextmeetingdate> save me </nextmeetingdate> </followupaction> </logitem> </customer> <customer customerid ="bobby"> <logitem logid ="1234"> <title> GOOD NEWS</title> <message> TEST</message> <bpsalesteam>3</bpsalesteam> <bptechnical>bob, billy</bptechnical> <externalother> sally, sue</externalother> <externaltechnical>mik, mikeee</externaltechnical> <contact contactname ="FRANK SPENCER" contacttel ="23345" contactmobile ="6778" contactemail ="NELLY@HOTMAIL"/> <logtype>tyh</logtype> <date>28/06/01</date> <followupaction> <priority> high</priority> <followupdetails> HELPME </followupdetails> <nextmeetingdate> SAVEME </nextmeetingdate> </followupaction> </logitem> </customer> </clientlog> The problem i have is that i cant access 1 distict record, without pulling out data from nodes that are NOT required. I am sure it is something to do with the contextual node?? however cant work it out!!! Here's the xsl file. <xsl:template match="clientlog/customer"> <xsl:value-of select="@customerid[.='bloggs']"/> <xsl:value-of select="//logitem/@logid"/> <xsl:value-of select="logitem/date"/> <xsl:value-of select="logitem/message"/> <xsl:value-of select="logitem/contact/@contactname"/> </xsl:template> </xsl:stylesheet> I am sure i am not approaching this correctly, can any on assist. thanks simon XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] Re: SGML vs XML, Christopher R. Maden | Thread | Re: [xsl] Avoiding selection of UNR, Wendell Piez |
RE: [xsl] Java code doing transform, Sebastian Schirmer | Date | Re: [xsl] It's going to work, even , Tim |
Month |