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

Re: regexp question

Subject: Re: regexp question
From: Bruce D'Arcus <bdarcus@xxxxxxxxxxxxx>
Date: Sun, 12 Sep 2004 17:40:19 -0400
regexp all caps
On Sep 12, 2004, at 5:09 PM, Michael Kay wrote:

I would do it like this:

<xsl:template match="img[matches(@src, '.*dropcap/.\.gif')]" mode="dropcap">
<xsl:value-of select="@alt"/>
</xsl:template>

That worked, once I added the namespace prefix.


Also, is there some reasonably reliable way -- again using
xslt 2.0 --
to take this ...

<meta name="byl" content="By C. J. CHIVERS and STEVEN LEE MYERS" />

.... and turn it into this:

   <meta name="author" content="Chivers, C. J." />
   <meta name="author" content="Myers, Steven Lee" />


It all depends on how wide the variations are in your source data. If you
want to do the above, while also changing "BOB DU CHARME" to "du Charme,
Bob", then you have got an interesting challenge on your hands. Try to
define the algorithm you want to use before you start asking how to code it
in XSLT.

I'm willing to let Bob's name get a bit mangled. I can always manually correct stuff that falls thought the cracks occasionally.


The most important thing is to get "surname, forename" so that I can more easily query and transform that later (into more finely parsed bibliographic records, for example). While there will be exceptions to this rule, I'm content enough to just say:

	-   a name is all caps
	-   within a name the last name is the surname
	-   anything before that are the forenames
	-   multiple names are delimited by either ", " or " and "

Titlecasing would be nice (though I note there's no such function in XSLT 2.0).

Bruce

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.