Jump to content
Sign in to follow this  

xsl:template match doesn't find matches

Recommended Posts

I feel so ashamed about this question, but I can't find a solution, and I hope you can help me.This is my code xml:

<?xml version="1.0" encoding="UTF-8"?> <?xml-stylesheet type="text/xsl" href="C:/Program%20Files/XML%20Copy%20Editor/esercizi%20xml/prova2.xsl"?><TEI xmlns="http://www.tei-c.org/ns/1.0"><teiHeader>	<fileDesc>		<titleStmt>			<title></title>		</titleStmt>		<publicationStmt><p>AA</p></publicationStmt>		<sourceDesc><p>AA</p></sourceDesc>	</fileDesc></teiHeader>	<text>	<body><div>	<head>Titolo</head>		<p>Scriverò un <rs>nome</rs> di luogo come questo:  <rs key="Persia" type="luogo">Persia</rs>.</p>	</div></body>	</text></TEI>

and this is what I wrote in my file xsl:

<?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:tei="http://www.tei-c.org/ns/1.0" xmlns="http://www.w3.org/1999/xhtml" version="1.0">  	<xsl:template match="/">  				<back>			<div>				<xsl:value-of select="//rs"/>			</div>		</back>			</xsl:template></xsl:stylesheet>

The output is:

<?xml version="1.0" encoding="UTF-8"?><back xmlns="http://www.w3.org/1999/xhtml" xmlns:tei="http://www.tei-c.org/ns/1.0">  <div/></back>

I don't understand where is my error; I suppose it is in the namespace, but I can't find the solution.Thank you in advice! --- EDIT: I've found the solution, is:"//tei:rs"

Edited by TMT

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...