Re: [xsl] selecting elements by attributes when working with namespaces

Subject: Re: [xsl] selecting elements by attributes when working with namespaces
From: Joelle Tegwen <tegwe002@xxxxxxx>
Date: Tue, 22 Jul 2008 09:20:32 -0500
<xsl:template match="tt:span[@class='defaultSpeaker']">
<xsl:if test="count(../preceding-sibling::*)>0">
<xsl:text
disable-output-escaping="yes">&lt;/dd&gt;</xsl:text>
</xsl:if>
<dt>
<xsl:value-of disable-output-escaping="yes" select="."/>
</dt>
<xsl:text disable-output-escaping="yes">&lt;dd&gt;</xsl:text>

Please, never, never do that. You are not generating correct XML regarding XDM, but you are instead cheating with the serializer. I didn't look in details of what you want, but you should be able to find another solution.

Never do which? I'm not quite sure what you're saying here.
  If not, please post a simple excerpt of your input and your expected
output.


I receive
<?xml version="1.0" encoding="UTF-8"?>
<tt xmlns="http://www.w3.org/2006/04/ttaf1"; xmlns:tts="http://www.w3.org/2006/04/ttaf1#styling"; xml:lang="en">
<head> <!-- omitted for brevity-->
</head>
<body id="thebody" style="defaultCaption">
<div xml:lang="en">
<p begin="0:00:22.10">
<span style="defaultSpeaker">Robert Bruininks</span>
<br/>I founded ICI, primarily out of a belief that the</p>
<p begin="0:00:27.80">University and its people had a great deal to</p>
<p begin="0:00:31.20">offer to the development of services for people</p>
<p begin="0:00:33.80">with disabilities in our society.</p>
<p begin="0:00:36.80">
<span style="defaultSpeaker">Sue Swenson</span>
<br/>The Institute on Community Integration</p>
<p begin="0:00:38.40">has a unique strength in being seen</p>
<p begin="0:00:41.80">as having more understanding of how</p>
<p begin="0:00:45.60">community programs work for folks with</p>
<p begin="0:00:48.10">intellectual disabilities and developmental</p>
<p begin="0:00:50.40">disabilities. It&#39;s not real regimented. It&#39;s not</p>
<p begin="0:00:53.20">like there&#39;s, you know, some guy in charge who tells</p>
<p begin="0:00:56.50">everybody else what to do. There&#39;s, I don&#39;t know,</p>
<p begin="0:00:58.80">a hundred and fifty, couple hundred people, each of</p>
<p begin="0:01:01.10">whom are exploring some of the ideas that they&#39;re</p>
<p begin="0:01:04.00">really interested in.</p>
</div>
</body>
</tt>


I want:
<div class="transcript">
<dl>
<dt>Robert Bruininks</dt>
<dd>&ldquo;I founded ICI, primarily out of a belief that the University and its people had a great deal to offer to the development of services for people with disabilities in our society. &rdquo;</dd>
<dt>Sue Swenson</dt>
<dd>&ldquo;The Institute on Community Integration has a unique strength in being seen as having more understanding of how community programs work for folks with intellectual disabilities and developmental disabilities. It's not real regimented. It's not like there's, you know, some guy in charge who tells everybody else what to do. There's, I don't know, a hundred and fifty, couple hundred people, each of whom are exploring some of the ideas that they're really interested in. &rdquo;</dd>
</dl>
</div>


Thanks
Joelle

Current Thread