www.webdeveloper.com
Results 1 to 2 of 2

Thread: can someone tell me what's wrong with this xslt file?

  1. #1
    Join Date
    May 2003
    Posts
    10

    can someone tell me what's wrong with this xslt file?

    can anyone identify what's wrong with the XSLT file. It passes the well formed check in XMLSPY, but bunks out on this line when I validate :

    Code:
    <xsl:apply-templates select="cancore:general" />
    saying 'unexpected child element'

    any clues?

    here's the xsl file :
    (note that I am not concerned with the transformation here, just the structure of the xslt documnet)

    Code:
    <xsl:stylesheet xmlns:cancore="http://www.imsglobal.org/xsd/imsmd_v1p2" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
    <xsl:output method = "xml" indent = "yes"/>
    
    <!-- apply the templates at the root level -->
    <xsl:template match="cancore:lom">
    	<metadata>
    		<!-- make the brace for the content -->
    
          <oai_dc:dc xmlns:oai_dc="http://www.openarchives.org/OAI/2.0/oai_dc/" 
             xmlns:dc="http://purl.org/dc/elements/1.1/" 
             xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
             xsi:schemaLocation="http://www.openarchives.org/OAI/2.0/oai_dc/ http://www.openarchives.org/OAI/2.0/oai_dc.xsd">
    
    				<xsl:apply-templates select="cancore:general" /> 
    				<xsl:apply-templates select="cancore:lifecycle/cancore:contribute" /> 
    				
    		</oai_dc:dc>
    	</metadata>
    </xsl:template>
    
          <!-- handle all the important information within the general tag!  -->
    	<xsl:template match="cancore:general">
    		<!-- title is a required field, no test required here -->
    		<dc:title>
    			 <xsl:apply-templates select="cancore:title/cancore:langstring" />	
    	 	</dc:title>
    		<dc:description>
    			 <xsl:apply-templates select="cancore:description/cancore:langstring" />	
    	 	</dc:description> 
    	 </xsl:template>
    
          <!-- handle all the important information within the lifecycle/role tag!  -->
    	<xsl:template match="cancore:lifecycle/cancore:contribute">
    		<!-- Get the creator tag information , it is optional so test -->
    		<xsl:if test="cancore:role/cancore:value/cancore:langstring = 'Author'">
    			<dc:creator>
    			 	<xsl:value-of select="cancore:centity/cancore:vcard" />				
    			</dc:creator>			 
    		</xsl:if>
    
    		<!-- Get the publisher tag information, it is optional so test -->
    		<!-- Get the publisher tag information, it is optional so test -->		
    		<xsl:if test="cancore:role/cancore:value/cancore:langstring = 'Publisher'">
    			<dc:publisher>
    			 	<xsl:value-of select="cancore:centity/cancore:vcard" />				
    			</dc:publisher>			 
    			<dc:date>
    			 	<xsl:value-of select="cancore:date" />
    			</dc:date>
    		</xsl:if>		
    	
          </xsl:template>
    
    
    
    </xsl:stylesheet>

  2. #2
    Join Date
    Dec 2002
    Location
    Calgary, Canada
    Posts
    2,653
    you need to post it somewhere,you can find people who have used these propritery tags....

    the best place I can recomend is here.

    http://www.mulberrytech.com/xsl/xsl-list/index.html

    The above is probably as good as it can get for xsl/xslt/xpath,xsl-fo support.

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles