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

Re: problem with fn:contains using xsl:param

Subject: Re: problem with fn:contains using xsl:param
From: Piotr Dobrogost <pd@xxxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 15 Dec 2009 01:34:20 +0100
Re:  problem with fn:contains using xsl:param
Date: Sun, 13 Dec 2009 23:06:28 -0000
From: "Michael Kay"<mike@xxxxxxxxxxxx>
Subject: RE:  problem with fn:contains using xsl:param
Message-ID:<909EFC046E7147B487D950129EBA61F4@Sealion>

(a) your code shouldn't be sensitive to the choice of prefixes used in the
source document (especially the xsd prefix, where half the community uses
"xsd" and the other half uses "xs")

I agree with you as I'm obsessed with universal solutions but it's not going to be one of them and namespace's prefix is well defined (xsd) and won't change.


(b) there are better ways of testing whether a value is one of a given list
of values:

That's what I was hoping to hear on this list and I'm very glad to hear this.


<xsl:param name="KnownXSDTypes" as="xsd:QName*"
   select="(xsd:QName('xsd:date'), xsd:QName('xsd:dateTime'),
xsd:QName('xsd:boolean')"/>

<xsl:template match="xsd:element[QName(@type, .) = $KnownXSDTypes">

How is this one different from Ken's proposal?
It does not seem to solve (a), does it?
Could you please comment on how to go about creating a map and using it to solve (b) and to map attribute's name to some string?


(With a schema-aware stylesheet, of course, you wouldn't have to do all the
explicit casting, this would be done automatically in the course of schema
validation).

Sorry for my lame question (I've only read XSLT 1.0 specification not 2.0) but what do you mean by schema-aware stylesheet? I guess that schema-aware stylesheet has knowledge about schema of xml document it translates. If it's so then someone would first have to create schema for our schema as my xsl translates _schema_ to Perl code :)



Regards Piotr Dobrogost

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.