[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Avoiding selection of UNREQUESTED elements?
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
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|