W3C home > Mailing lists > Public > www-xsl-fo@w3.org > May 2008

Re: Sanitizing data

From: David Arakelian <david@theatons.com>
Date: Tue, 13 May 2008 09:58:51 +0100
To: www-xsl-fo@w3.org
Message-Id: <1210669131.6942.17.camel@dhopkins-laptop>

Hi JV, is it possible to have some code examples, I am not 100% sure of
what you are dealing with or trying to achieve. I think this may help
though:

** XML **

<root>
	<mynode>
		<mychild>Fela</mychild>
		<mychild>Femi</mychild>
		<mychild>Seun</mychild>
	</mynode>
</root>

If you are expecting just a single child for mynode, you could do
something like this.

** XSL **

<xsl:choose>
	<xsl:when test="count( //mynode/mychild ) = 1">
		<xsl:value-of select="//mynode/mychild" />
	</xsl:when>
	<xsl:otherwise>
		Some error message
	</xsl:otherwise>
</xsl:choose>


-- 
      ,'/:.          David Arakelian 
    ,'-/::::.        http://www.theatons.com/
  ,'--/::(@)::.      Web Security Consultant
,'---/::::::::::.    Wales
____/:::::::::::::.  
  T H E A T O N S  
Received on Tuesday, 13 May 2008 15:30:23 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 13 May 2008 15:30:31 GMT