This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Avoiding selection of UNREQUESTED elements?
- To: XSL-List at lists dot mulberrytech dot com
- Subject: [xsl] Avoiding selection of UNREQUESTED elements?
- From: Simon Knee <skn at bauer-partner dot de>
- Date: Thu, 28 Jun 2001 10:04:55 +0100
- Reply-To: xsl-list at lists dot mulberrytech dot com
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