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

RE: 2 questions

Subject: RE: 2 questions
From: "Michael Kay" <michael.h.kay@xxxxxxxxxxxx>
Date: Wed, 1 May 2002 14:26:43 +0100
RE:  2 questions
> 1) I know that there is no need to check for
> string-length() when checking to see if an element is
> empty or not, but the following checks seem to be
> failing in my XSLT and I am not sure why.

You don't show your source XML, but if you are testing for empty elements
then your code is wrong.

<xsl:if test="JobTitle"> tests if a JobTitle element exists
<xsl:if test="JobTitle!=''"> tests if a non-empty JobTitle element exists
(where "empty" means that its string-value is an empty string)

>
> 2) How does one check to see what the parent of an
> element is? I am currently trying this, with no luck.
>
> <xsl:template
> match="Link[parent::node()='RelatedLinks']">
>
> I want only those links elements that have the parent
> element 'RelatedLinks,'

    <xsl:template match="RelatedLinks/Link">

or if you prefer

    <xsl:template match="Link[parent::RelatedLinks]">

You are testing the content of the parent element, not its name.

Michael Kay
Software AG
home: Michael.H.Kay@xxxxxxxxxxxx
work: Michael.Kay@xxxxxxxxxxxxxx
>


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread
  • 2 questions
    • Nathan Shaw - Wed, 1 May 2002 08:40:46 -0400 (EDT)
      • Michael Kay - Wed, 1 May 2002 09:19:45 -0400 (EDT) <=

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.