[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Avoiding selection of UNREQUESTED elements?

Subject: Avoiding selection of UNREQUESTED elements?
From: Simon Knee <skn@xxxxxxxxxxxxxxxx>
Date: Thu, 28 Jun 2001 10:04:55 +0100
simon knee
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

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.