Commit 8b1ba4ab authored by Baptiste Montange's avatar Baptiste Montange
Browse files

xslt sections

parents f02f1e91 798a47f5
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:h2m="http://www.utc.fr/hdoc/hdoc_to_mongo">
<xsl:function name="h2m:escape-string">
<xsl:param name="value"/>
"<xsl:value-of select="replace($value, '&quot;', '\\&quot;')"/>"
</xsl:function>
</xsl:stylesheet>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project name="hdoc_to_pdf" basedir="." default="convert">
<!--<taskdef resource="net/sf/antcontrib/antcontrib.properties">
<classpath>
<pathelement location="lib/ant-contrib.jar" />
</classpath>
</taskdef>-->
<project name="hdoc_to_pdf" basedir="." default="main">
<!-- OS properties -->
<condition property="isMac">
<os family="mac"/>
</condition>
<condition property="isWindows">
<os family="windows"/>
</condition>
<condition property="isUnix">
<os family="unix"/>
</condition>
<!-- Arguments properties -->
<property name="InputPath" location="input" />
<property name="OutputPath" location="output" />
<property name="InputPath" location="input"/>
<property name="OutputPath" location="output"/>
<property name="tmp" location="${basedir}/tmp"/>
<property name="OutputPdfPath" location="${OutputPath}/result.pdf" />
<property name="OutputPdfPath" location="${OutputPath}/result.pdf"/>
<target name="main" depends="convertMac, convertWindows, convertUnix">
<!--temporary files and folders are deleted-->
<delete dir="${tmp}"/>
<delete file="prepare_hdoc.ant"/>
</target>
<!-- Mac target -->
<target name="convertMac" if="isMac" depends="hdocPreparation">
<!--launches the FS/Java script and get a converted PDF file in the output directory-->
<exec executable="java">
<arg value="-cp"/>
<arg value="lib/core-renderer.jar:lib/iText-2.0.8.jar"/>
<arg value="org.xhtmlrenderer.simple.PDFRenderer"/>
<arg value="${tmp}/final.xhtml"/>
<arg value="${OutputPath}/result.pdf"/>
</exec>
</target>
<!-- Windows target -->
<target name="convertWindows" if="isWindows" depends="hdocPreparation">
<!--launches the FS/Java script and get a converted PDF file in the output directory-->
<exec executable="java">
<arg value="-cp"/>
<arg value="lib/core-renderer.jar;lib/iText-2.0.8.jar"/>
<arg value="org.xhtmlrenderer.simple.PDFRenderer"/>
<arg value="${tmp}/final.xhtml"/>
<arg value="${OutputPath}/result.pdf"/>
</exec>
</target>
<!-- Linux target -->
<target name="convertUnix" if="isUnix">
<!--launches the FS/Java script and get a converted PDF file in the output directory-->
<exec executable="java">
<arg value="-cp"/>
<arg value="lib/core-renderer.jar:lib/iText-2.0.8.jar"/>
<arg value="org.xhtmlrenderer.simple.PDFRenderer"/>
<arg value="${tmp}/final.xhtml"/>
<arg value="${OutputPath}/result.pdf"/>
</exec>
</target>
<target name="convert">
<echo message="The value of property of InputPath is ${InputPath}" />
<echo message="The value of property of OutputPath is ${OutputPath}" />
<echo message="The value of property of tmp is ${tmp}" />
<target name="hdocPreparation">
<echo message="The value of property of InputPath is ${InputPath}"/>
<echo message="The value of property of OutputPath is ${OutputPath}"/>
<echo message="The value of property of tmp is ${tmp}"/>
<!-- Creation of temp dir -->
<delete dir="${tmp}" failonerror="false"/>
......@@ -28,12 +77,12 @@
<fileset id="fileset_hdoc" dir="${InputPath}" casesensitive="yes">
<include name="*.hdoc"/>
</fileset>
<pathconvert property="HdocFile" pathsep="" refid="fileset_hdoc" />
<pathconvert property="HdocFile" pathsep="" refid="fileset_hdoc"/>
<echo message="Executing conversion..." />
<echo message="Executing conversion..."/>
<!-- Unzips the hdoc to be converted-->
<unzip dest="${tmp}" src ="${HdocFile}"/>
<unzip dest="${tmp}" src="${HdocFile}"/>
<!-- Gives all rights to avoid bugs-->
<chmod dir="${tmp}" perm="777"/>
......@@ -46,16 +95,6 @@
<!--launches the ANT prepare_hdoc.ant resulting from the previous XSLT in order to get a clean xhtml ready for the pdf conversion -->
<ant antfile="prepare_hdoc.ant"/>
<!--launches the ANT xxx to execute the FS/Java script and get a converted PDF file in the output directory-->
<!--TODO-->
<!--temporary files and folders are deleted-->
<!--<delete dir="${tmp}"/>-->
<!--<delete file="prepare_hdoc.ant"/>-->
</target>
</project>
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:h="urn:utc.fr:ics:hdoc:container"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
name="hdoc_to_pdf"
default="main">
<target name="main">
<xslt in="/home/raphael/Documents/Travail/NF29/projet/hdoc/hdoc_to_pdf/tmp/content.xml"
out="/home/raphael/Documents/Travail/NF29/projet/hdoc/hdoc_to_pdf/tmp/hdoc_nsless.xhtml"
style="xsl/ns_remover.xsl"/>
<xslt in="/home/raphael/Documents/Travail/NF29/projet/hdoc/hdoc_to_pdf/tmp/hdoc_nsless.xhtml"
out="/home/raphael/Documents/Travail/NF29/projet/hdoc/hdoc_to_pdf/tmp/flat_hdoc.xhtml"
style="xsl/hdoc_flattenizer.xsl"/>
</target>
</project>
......@@ -23,5 +23,6 @@
<xslt in="{$TempRepository}/{$path}" out="{$TempRepository}/hdoc_nsless.xhtml" style="xsl/ns_remover.xsl"/>
<xslt in="{$TempRepository}/hdoc_nsless.xhtml" out="{$TempRepository}/flat_hdoc.xhtml" style="xsl/hdoc_flattenizer.xsl"/>
<xslt in="{$TempRepository}/flat_hdoc.xhtml" out="{$TempRepository}/final.xhtml" style="xsl/last_transformer.xsl"/>
</xsl:template>
</xsl:stylesheet>
......@@ -2,10 +2,61 @@
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema">
xpath-default-namespace="http://www.w3.org/1999/xhtml"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="http://www.w3.org/1999/xhtml"
>
<xsl:output method="xml" indent="yes"/>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="html">
<Helloworld/>
<html>
<xsl:apply-templates/>
</html>
</xsl:template>
<xsl:template match="head">
<head>
<xsl:apply-templates select="node()|@*"/>
<link>
<xsl:attribute name="ref">stylesheet</xsl:attribute>
<xsl:attribute name="type">text/css</xsl:attribute>
<xsl:attribute name="href">css/main.css</xsl:attribute>
</link>
</head>
</xsl:template>
<xsl:template match="section">
<xsl:variable name="level" select="count(ancestor::section) + 1"/>
<div>
<xsl:element name="h{$level}">
<xsl:value-of select="header/h1"/>
</xsl:element>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="header">
</xsl:template>
<xsl:template match="div">
<xsl:variable name="level" select="count(ancestor::section) + 1"/>
<div>
<xsl:element name="h{$level}">
<xsl:value-of select="h6"/>
</xsl:element>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="h6">
</xsl:template>
</xsl:stylesheet>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xpath-default-namespace="http://www.w3.org/1999/xhtml">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>
......@@ -239,6 +239,57 @@
</xsl:element>
</xsl:template>
<!-- QCMs -->
<xsl:template match="node[contains(@TEXT, '#question')]" priority="2">
<xsl:element name="section">
<xsl:element name="header">
<xsl:element name="h1">QCM</xsl:element>
</xsl:element>
<xsl:element name="div">
<xsl:attribute name="data-hdoc-type">question</xsl:attribute>
<xsl:element name="ul">
<xsl:element name="li">
<xsl:element name="p">
<xsl:value-of select="utc:remove-language(@TEXT)"/>
</xsl:element>
</xsl:element>
</xsl:element>
</xsl:element>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<!-- Match the global explanation of of a question within a QCM -->
<xsl:template match="node[contains(@TEXT, '#explanation')]" priority="2">
<xsl:element name="div">
<xsl:attribute name="data-hdoc-type">explanation</xsl:attribute>
<xsl:element name="p">
<xsl:value-of select="utc:remove-language(@TEXT)"/>
</xsl:element>
</xsl:element>
</xsl:template>
<!-- Match the correct answers of a question within a QCM -->
<xsl:template match="node[contains(@TEXT, '#choice-correct')]" priority="2">
<xsl:element name="div">
<xsl:attribute name="data-hdoc-type">choice-correct</xsl:attribute>
<xsl:element name="p">
<xsl:value-of select="utc:remove-language(@TEXT)"/>
</xsl:element>
</xsl:element>
</xsl:template>
<!-- Match the wrong answers of a question within a QCM -->
<xsl:template match="node[contains(@TEXT, '#choice-incorrect')]" priority="2">
<xsl:element name="div">
<xsl:attribute name="data-hdoc-type">choice-incorrect</xsl:attribute>
<xsl:element name="p">
<xsl:value-of select="utc:remove-language(@TEXT)"/>
</xsl:element>
</xsl:element>
</xsl:template>
<!-- Default behavior for intro and conclu nodes : do nothing -->
<xsl:template match="node[contains(@TEXT, '#intro')] | node[contains(@TEXT, '#conclu')]"
priority="3"/>
......@@ -251,7 +302,7 @@
<xsl:function name="utc:remove-language" as="xs:string">
<xsl:param name="text" as="xs:string?"/>
<xsl:variable name="text2" select="string($text)"/>
<xsl:value-of select="replace($text2, '(#[0-9a-z]* )+', '')"/>
<xsl:value-of select="replace($text2, '(#[0-9a-z|-]* )+', '')"/>
</xsl:function>
</xsl:stylesheet>
......@@ -149,3 +149,11 @@ The opale_to_hdoc converter transcribes an Opale publication to a hdoc format. O
The source code converter is available and can be completed in order to
improve it and manage more Opale elements.
Modified by Benoit Villain (12/12/2016)
------------------
Les divisions et les parties d'un grain n'étaient pas traitées... Contrairement à ce que mentionne le README...
J'ai donc apporté les modifications nécessaires pour que les divisions et les parties (récursives) soient bel et bien transformées en "section" hdoc.
<?xml version="1.0" encoding="UTF-8"?>
<!-- Namespaces -->
<xsl:stylesheet
xmlns="http://www.utc.fr/ics/hdoc/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xs"
version="2.0"
xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"
xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive"
xmlns:op="utc.fr:ics/opale3">
<xsl:stylesheet xmlns="http://www.utc.fr/ics/hdoc/xhtml"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xs" version="2.0" xmlns:sc="http://www.utc.fr/ics/scenari/v3/core"
xmlns:sp="http://www.utc.fr/ics/scenari/v3/primitive" xmlns:op="utc.fr:ics/opale3">
<xsl:template match="sc:item">
<xsl:apply-templates/>
......@@ -44,63 +38,92 @@
<!-- Information -->
<xsl:template match="op:ueM/sp:info">
<xsl:apply-templates select="op:info/sp:keywds/op:keywds/sp:keywd" />
<xsl:apply-templates select="op:info/sp:cc" />
<xsl:apply-templates select="op:info/sp:cpyrgt/op:sPara/sc:para" />
<xsl:apply-templates select="op:info/sp:keywds/op:keywds/sp:keywd"/>
<xsl:apply-templates select="op:info/sp:cc"/>
<xsl:apply-templates select="op:info/sp:cpyrgt/op:sPara/sc:para"/>
</xsl:template>
<!-- Titles -->
<xsl:template match="op:uM/sp:title | op:expUcDivM/sp:title">
<h1><xsl:value-of select="." /></h1>
<xsl:template match="op:uM/sp:title | op:expUcDivM/sp:title | op:ueDivM/sp:title">
<h1>
<xsl:value-of select="."/>
</h1>
</xsl:template>
<xsl:template match="op:ueM/sp:title">
<title><xsl:value-of select="." /></title>
<title>
<xsl:value-of select="."/>
</title>
</xsl:template>
<xsl:template match="op:pbTi/sp:title">
<h6><xsl:value-of select="." /></h6>
<h6>
<xsl:value-of select="."/>
</h6>
</xsl:template>
<!-- Subtitle -->
<xsl:template match="op:uM/sp:sTitle">
<h2><xsl:value-of select="." /></h2>
<h2>
<xsl:value-of select="."/>
</h2>
</xsl:template>
<!-- Liscences -->
<xsl:template match="op:ueM/sp:info/op:info/sp:cc">
<meta name="rights" content="{.}" />
<meta name="rights" content="{.}"/>
</xsl:template>
<xsl:template match="op:uM/sp:info/op:info/sp:cc">
<div data-hdoc-type="rights">
<xsl:value-of select="." />
<xsl:value-of select="."/>
</div>
</xsl:template>
<!-- Keywords -->
<xsl:template match="op:ueM/sp:info/op:info/sp:keywds/op:keywds/sp:keywd">
<meta name="keywords" content="{.}" />
<meta name="keywords" content="{.}"/>
</xsl:template>
<xsl:template match="op:uM/sp:info/op:info/sp:keywds">
<div data-hdoc-type="tags">
<xsl:apply-templates select="./op:keywds/sp:keywd" />
<xsl:apply-templates select="./op:keywds/sp:keywd"/>
</div>
</xsl:template>
<xsl:template match="op:uM/sp:info/op:info/sp:keywds/op:keywds/sp:keywd">
<span><xsl:value-of select="." /></span>
<span>
<xsl:value-of select="."/>
</span>
</xsl:template>
<!-- Author -->
<xsl:template match="op:ueM/sp:info/op:info/sp:cpyrgt/op:sPara/sc:para">
<meta name="author" content="{.}" />
<meta name="author" content="{.}"/>
</xsl:template>
<xsl:template match="op:uM/sp:info/op:info/sp:cpyrgt/op:sPara/sc:para">
<div data-hdoc-type="author">
<xsl:value-of select="." />
<xsl:value-of select="."/>
</div>
</xsl:template>
<!-- Division -->
<xsl:template match="/sc:item/*[namespace-uri()='utc.fr:ics/opale3' and local-name()='ue'][1]/*[namespace-uri()='http://www.utc.fr/ics/scenari/v3/primitive' and local-name()='div']">
<xsl:apply-templates select="./op:ueDiv/sp:courseUa|./op:ueDiv/sp:courseUc"/>
<xsl:template match="op:ue/sp:div | op:ueDiv/sp:div">
<section>
<header>
<xsl:apply-templates select="./op:ueDiv/op:ueDivM/sp:title"/>
<xsl:apply-templates
select="./op:ueDiv/op:ueDivM/sp:info/op:info/sp:cpyrgt/op:sPara/sc:para"/>
<xsl:apply-templates select="./op:ueDiv/op:ueDivM/sp:info/op:info/sp:cc"/>
</header>
<!-- check for sub-division -->
<xsl:apply-templates select="./op:ueDiv/sp:div"/>
<!-- currently : grain & introduction & conclusion -->
<xsl:apply-templates select="./op:ueDiv/sp:intro"/>
<xsl:apply-templates select="./op:ueDiv/sp:courseUc"/>
<xsl:apply-templates select="./op:ueDiv/sp:conclu"/>
<footer>
<xsl:apply-templates select="./op:ueDiv/op:ueDivM/sp:info/op:info/sp:keywds"/>
</footer>
</section>
</xsl:template>
<!-- Activity -->
......@@ -108,16 +131,16 @@
<section>
<header>
<xsl:apply-templates select="./op:courseUa/op:uM/sp:title"/>
<xsl:apply-templates select="./op:courseUa/op:uM/sp:info/op:info/sp:cpyrgt/op:sPara/sc:para"/>
<xsl:apply-templates
select="./op:courseUa/op:uM/sp:info/op:info/sp:cpyrgt/op:sPara/sc:para"/>
<xsl:apply-templates select="./op:courseUa/op:uM/sp:info/op:info/sp:cc"/>
</header>
<!-- currently : grain & introduction & conclusion -->
<!-- <xsl:apply-templates select="./op:courseUa/child::*[name() != 'op:uM'][name() != 'sp:quest']"/>-->
<xsl:apply-templates select="./op:courseUa/sp:courseUc"/>
<xsl:apply-templates select="./op:courseUa/sp:obj"/>
<xsl:apply-templates select="./op:courseUa/sp:intro"/>
<xsl:apply-templates select="./op:courseUa/sp:courseUc"/>
<xsl:apply-templates select="./op:courseUa/sp:conclu"/>
<xsl:apply-templates select="./op:courseUa/sp:obj"/>
<!-- overview questions : regroup questions into a section-->
<xsl:if test="./op:courseUa/sp:quest">
......@@ -127,7 +150,7 @@
</header>
<!-- a conclusion has only a bloc -->
<div>
<xsl:apply-templates select="./op:courseUa/sp:quest" />
<xsl:apply-templates select="./op:courseUa/sp:quest"/>
</div>
</section>
</xsl:if>
......@@ -143,14 +166,17 @@
<section>
<header>
<xsl:apply-templates select="./op:expUc/op:uM/sp:title"/>
<xsl:apply-templates select="./op:expUc/op:uM/sp:info/op:info/sp:cpyrgt/op:sPara/sc:para"/>
<xsl:apply-templates
select="./op:expUc/op:uM/sp:info/op:info/sp:cpyrgt/op:sPara/sc:para"/>
<xsl:apply-templates select="./op:expUc/op:uM/sp:info/op:info/sp:cc"/>
</header>
<!-- call for blocs and parts -->
<!-- <xsl:apply-templates select="./op:expUc/child::*[name() != 'op:uM']"/>-->
<!-- call for blocs -->
<xsl:apply-templates select="./op:expUc/sp:pb/op:pb/*"/>
<!-- call for parts -->
<xsl:apply-templates select="./op:expUc/sp:div"/>
<footer>
<xsl:apply-templates select="./op:expUc/op:uM/sp:info/op:info/sp:keywds"/>
</footer>
......@@ -207,15 +233,18 @@
</xsl:template>
<!-- Parts (of a Grain) -->
<xsl:template match="sp:div">
<xsl:template match="op:expUc/sp:div | op:expUcDiv/sp:div">
<section>
<header>
<!-- only title - parts don't have other metadata -->
<xsl:apply-templates select="./op:expUcDiv/op:expUcDivM/sp:title"/>
</header>
<!-- a part can contain blocs and other parts -->
<xsl:apply-templates select="./op:expUcDiv/child::*[name() != 'op:expUcDivM']"/>
<!-- call for blocs -->
<xsl:apply-templates select="./op:expUcDiv/sp:pb/op:pb/*"/>
<!-- call for parts -->
<xsl:apply-templates select="./op:expUcDiv/sp:div"/>
</section>
</xsl:template>
......@@ -224,110 +253,110 @@
<!-- ***** BLOCS START ***** -->
<xsl:template match="sp:res[op:resInfoM/sp:index/text() = 'img']">
<xsl:variable name="name" select="tokenize(@sc:refUri, '/')[last()]"></xsl:variable>
<xsl:variable name="name" select="tokenize(@sc:refUri, '/')[last()]"/>
<img src="re/{$name}" alt="{$name}"/>
</xsl:template>
<xsl:template match="sp:res[op:resInfoM/sp:index/text() = 'graph']">
<xsl:variable name="name" select="tokenize(@sc:refUri, '/')[last()]"></xsl:variable>
<xsl:variable name="name" select="tokenize(@sc:refUri, '/')[last()]"/>
<object data="re/{$name}" type="application/vnd.oasis.opendocument.graphics"/>
</xsl:template>
<xsl:template match="sp:res[op:resInfoM/sp:index/text() = 'tab']">
<xsl:variable name="name" select="tokenize(@sc:refUri, '/')[last()]"></xsl:variable>
<xsl:variable name="name" select="tokenize(@sc:refUri, '/')[last()]"/>
<object data="re/{$name}" type="application/vnd.oasis.opendocument.spreadsheet"/>
</xsl:template>
<!-- content Information : no microformat -->
<xsl:template match="sp:pb/op:pb/sp:info">
<div>
<xsl:apply-templates select="./op:pbTi/sp:title" />
<xsl:apply-templates select="op:res/*" />
<xsl:apply-templates select="./op:pbTi/sp:title"/>
<xsl:apply-templates select="op:res/*"/>
</div>
</xsl:template>
<!-- content definition : definition -->
<xsl:template match="sp:pb/op:pb/sp:def">
<div data-hdoc-type="definition">
<xsl:apply-templates select="./op:pbTi/sp:title" />
<xsl:apply-templates select="op:res/*" />
<xsl:apply-templates select="./op:pbTi/sp:title"/>
<xsl:apply-templates select="op:res/*"/>
</div>
</xsl:template>
<!-- content example : example -->
<xsl:template match="sp:pb/op:pb/sp:ex">
<div data-hdoc-type="example">
<xsl:apply-templates select="./op:pbTi/sp:title" />
<xsl:apply-templates select="op:res/*" />
<xsl:apply-templates select="./op:pbTi/sp:title"/>
<xsl:apply-templates select="op:res/*"/>
</div>
</xsl:template>
<!-- content remark : remark -->
<xsl:template match="sp:pb/op:pb/sp:rem">
<div data-hdoc-type="remark">
<xsl:apply-templates select="./op:pbTi/sp:title" />
<xsl:apply-templates select="op:res/*" />
<xsl:apply-templates select="./op:pbTi/sp:title"/>
<xsl:apply-templates select="op:res/*"/>
</div>
</xsl:template>
<!-- content advice : advice -->
<xsl:template match="sp:pb/op:pb/sp:adv">
<div data-hdoc-type="advice">
<xsl:apply-templates select="./op:pbTi/sp:title" />
<xsl:apply-templates select="op:res/*" />
<xsl:apply-templates select="./op:pbTi/sp:title"/>
<xsl:apply-templates select="op:res/*"/>
</div>
</xsl:template>
<!-- content warning : warning -->
<xsl:template match="sp:pb/op:pb/sp:warning">
<div data-hdoc-type="warning">
<xsl:apply-templates select="./op:pbTi/sp:title" />
<xsl:apply-templates select="op:res/*" />
<xsl:apply-templates select="./op:pbTi/sp:title"/>
<xsl:apply-templates select="op:res/*"/>
</div>
</xsl:template>
<!-- content complement : complement -->
<xsl:template match="sp:pb/op:pb/sp:comp">
<div data-hdoc-type="complement">
<xsl:apply-templates select="./op:pbTi/sp:title" />
<xsl:apply-templates select="op:res/*" />
<xsl:apply-templates select="./op:pbTi/sp:title"/>
<xsl:apply-templates select="op:res/*"/>
</div>
</xsl:template>
<!-- content method : advice -->
<xsl:template match="sp:pb/op:pb/sp:meth">
<div data-hdoc-type="advice">
<xsl:apply-templates select="./op:pbTi/sp:title" />
<xsl:apply-templates select="op:res/*" />
<xsl:apply-templates select="./op:pbTi/sp:title"/>
<xsl:apply-templates select="op:res/*"/>
</div>