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

Re: XSL questions

Subject: Re: XSL questions
From: David Carlisle <davidc@xxxxxxxxx>
Date: Thu, 1 Jun 2006 18:14:40 +0100
Re:  XSL questions
> I have a element definited in a DTD file as 
> 
> <!ELEMENT Para (#PCDATA | Emphasis)*>
> 
> I need to the content of the element contains the html list tags, eg. <ul><LI>first</LI><LI>second</LI></ul>.
> 
> XMLSpy says that is invalid since the parent elements' content disallow element ul. 

XMLSpy is correct to say that's invalid, the dtd says you may not have
html elements there and you say you need them, so you need to ignore the
dtd or to change the dtd. XSLT doesn't care, if you generate the html
elements in a way that is not valid you get no warning from xslt.

> The position function doesn't work for my need. It returns the total number of elements. 
No it doesn't, it returns the position of thee current node in the
current node list.

> I have tried to use the count on an element/attribute. I don't know
> why it always returns one. 

> ... count(@id) 

I'm not sure what value you'd expect it to return, @id selects all the
id attributes of the current node, and there can only ever be at most 1
attribute with the same name, so this will always be 1 (if there is an
id) or 0 otherwise.

		<xsl:for-each select=" ...">
					<xsl:if test="$current_id = @relatedPerson">
		
					</xsl:if>
				</xsl:for-each>

don't do that, just select the nodes that you want

		<xsl:for-each select=" ...[$current_id = @relatedPerson]">
		</xsl:for-each>

David

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________

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-2007 All Rights Reserved.