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

Re: Transforming Learning Object Metadata (LOM) proble

Subject: Re: Transforming Learning Object Metadata (LOM) problem.
From: "Jaebin Lee" <jaebin.charade@xxxxxxxxx>
Date: Tue, 12 Sep 2006 10:00:41 +0200
jaebin lee
Thanks.
Thank you.
I think I'm almost to what I want, but still having problem with keys.
I'm confused in how to deal with x-path that I'm using match of <xsl:key>

In my file, I have,,

<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:l =
"http://ltsc.ieee.org/xsd/LOMv1p0">
					
	<xsl:key name="gen-identifier" match="//l:general/identifier/*" use="name()"/>

... and some html and matching stuffs...

  <xsl:apply-templates select="l:lom"/>
	
  <xsl:template match="l:lom">
	<xsl:apply-templates select="l:general"/>
  </xsl:template>

  <xsl:template match="l:general">
	 <xsl:apply-templates select="l:identifier"/>
  </xsl:template>

<xsl:template match="l:identifier | l:title | l:description |
l:keyword | l:version | l:source">
	<xsl:choose>
	   <xsl:when test="name() = 'identifier' ">
		<xsl:for-each select="* [ count( . | key( 'gen-identifier', name()
)[1] ) = 1 ] ">
			&lt;FIELD name="<xsl:value-of select="local-name()"/>&gt;<br/>
			<xsl:for-each select="key('gen-identifier', local-name())">
			       <xsl:value-of select="current()"/><br/>
			</xsl:for-each>
			&lt;/FIELD&gt;<br/>
		</xsl:for-each>

so on.......

In the key declaration,
<xsl:key name="gen-identifier" match="//l:general/identifier/*" use="name()"/>
1. what would be the right way to put "l" prefix in match?
2. does it have to be also applied to name?
3. and when you actually use key element in template, how should the
prefix applied to?
4. Lastly, in test statement, I compare name with certain string, and
does that not need to have any namespace prefix I believe? is that
correct?

Could anyone please give a hint?
Thank you!

-Jaebin


On 9/12/06, David Carlisle <davidc@xxxxxxxxx> wrote:


> I believe this also applies to "apply-template" statements, so for
> example would I need to put namespace prefix to

yes in both select expressions (including use= and test= attribute) and
match expresions in templates and keys, you need to use prefixes to
refer to an element in a namespace, otherwise you are refering to
elements in no-namespace.

David

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.