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

Re: XSLT validation with external file using Key

Subject: Re: XSLT validation with external file using Key
From: "G. Ken Holman" <gkholman@xxxxxxxxxxxxxxxxxxxx>
Date: Wed, 08 Jul 2009 16:13:32 -0400
Re:  XSLT validation with external file using Key
At 2009-07-08 15:36 -0400, Knight, Michel wrote:
Using Saxon 9
Windows
XSLT/XPATH version 2
--------------------------------------
Source File : student.htm
XSLT            : testKey.xslt
XML             : validated_data_test.xml   (Note My validation files as
over 2 000 possible values)

This XSLT goes and against an html file and use an XML file to validated
data.
This is workng nicely but it doesn't do everything I want.

It doesn't take care of (uppercase,White Space) so if one is
uppercase(HTML file) and it's lower-case in the XML(validation file)
it doesn't pick it up.

I've tried pluggin in normalize-space and lower-case with no success,

Your test data happens not to need space or case normalization so I hacked the HTML to have lower-case "crafts" and the following worked for me:


<xsl:key name="keyrefname" match="ref"
         use="lower-case(normalize-space(.))"/>
...
test="empty(key('keyrefname',lower-case(normalize-space($keyref))))">

The essence is to ensure that the values used for search are the values loaded up in the key table.

Your guidance would be appreciated.

I hope this helps.


. . . . . . . Ken

--
Possible July/August XSLT/XQuery/XSL-FO training in Oakland/CA/USA
Crane Softwrights Ltd.          http://www.CraneSoftwrights.com/s/
Training tools: Comprehensive interactive XSLT/XPath 1.0/2.0 video
Video lesson:    http://www.youtube.com/watch?v=PrNjJCh7Ppg&fmt=18
Video overview:  http://www.youtube.com/watch?v=VTiodiij6gE&fmt=18
G. Ken Holman                 mailto:gkholman@xxxxxxxxxxxxxxxxxxxx
Male Cancer Awareness Nov'07  http://www.CraneSoftwrights.com/s/bc
Legal business disclaimers:  http://www.CraneSoftwrights.com/legal

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.