Bonjour tout le monde,
J'ai un soucis avec ma feuille d'extraction xslt que je vous montre ici:
Code XML:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| <?xml version="1.0" encoding="Cp1252"?>
<html><body class="noscroll">
<div class="rcmBody" lang="EN-US">
<div class="WordSection1">
<p style="margin: 0in; margin-bottom: .0001pt"><span style="font-size: 11.0pt; font-family: "Calibri","sans-serif"">_ _ _ _ _ _ _ _ _ _ _ _
</span></p>
<p class="MsoNormal"><span style="font-size: 10.0pt">http://thehill.com/opinion/op-ed/220075-congress-needed-on-water-power</span></p>
<p class="MsoNormal"><b><span style="font-size: 10.0pt">TI: Congress needed on water, power</span></b></p>
<p class="MsoNormal"><span style="font-size:10.0pt">CO: Blablabla blabla</span></p>
<p class="MsoNormal"><span style="font-size: 10.0pt">AB: By Jon Freedman (GEWPT) - 10/07/14 By now most people are all too familiar with the extended drought in the American Southwest. Pictures of wildfires in California, decimated agricultural lands and the
effects of a diminishing water supply regularly make the news. What most people might not know, yet just as devastating, is the potential effect of the 14-year drought in the Colorado River basin on the Southwests energy supply</span></p>
<p style="margin: 0in; margin-bottom: .0001pt"><span style="font-size: 11.0pt; font-family: "Calibri","sans-serif"">_ _ _ _ _ _ _ _ _ _ _ _
</span></p>
<p class="MsoNormal"><span style="font-size: 10.0pt">*</span></p>
<p class="MsoNormal"><span style="font-size: 10.0pt">http://www.whatech.com/market-research-reports/press-release/industrial/31670-global-water-level-sensor-industry-report-2014</span></p>
<p class="MsoNormal"><b><span style="font-size: 10.0pt">TI:* Global water level sensor industry explored in new report</span></b></p>
<p class="MsoNormal"><span style="font-size:10.0pt">CO: BlueField Research</span></p>
<p class="MsoNormal"><span style="font-size: 10.0pt">AB: This report has introduced Water Level Sensor basic information included Water Level Sensor definition classification application industry chain structure industry overview.</span></p>
<p class="MsoNormal"><span style="font-size: 10.0pt">To access full report with TOC, please visit 2014 Market Research Report on Global Water Level Sensor Industry (http://www.reportstack.com/product/175905/2014-market-research-report-on-global-water-level-sensor-industry.html#src=whatech)</span></p>
</div>
</div>
</body></html> |
Code xslt:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
| <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xhtml="http://www.w3.org/1999/xhtml" version="1.0">
<xsl:output encoding="UTF-8" method="xml" indent="yes"/>
<xsl:template match="html">
<sections>
<xsl:apply-templates select="//div[@class='WordSection1']"/>
</sections>
</xsl:template>
<xsl:template match="//div[@class='WordSection1']">
<xsl:for-each select="p[contains(.,'_ _ _ _ _ _ _ ')]">
<section>
<title>
<xsl:value-of select="substring-after(following-sibling::p//span[contains(text(),'TI:')],'TI:')"/>
</title>
<details>
<HTML>
<xsl:value-of select="following-sibling::p//span[contains(text(),'CO:')]"/>
<br/><br/>
<xsl:value-of select="following-sibling::p//span[contains(text(),'AB:')]"/>
<xsl:value-of select="following-sibling::p//span[contains(text(),'')]"/>
</HTML>
</details>
<commentary></commentary>
<links>
<xsl:value-of select="following-sibling::p//span[contains(text(),'http:')]"/>
</links>
<from></from>
</section>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet> |
Résultat actuel:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22
| <?xml version="1.0" encoding="UTF-8"?>
<sections xmlns:xhtml="http://www.w3.org/1999/xhtml">
<section>
<title> Congress needed on water, power</title>
<details>
<HTML>CO: Blablabla blabla<br/><br/>AB: By Jon Freedman (GEWPT) - 10/07/14 By now most people are all too familiar with the extended drought in the American Southwest. Pictures of wildfires in California, decimated agricultural lands and the
effects of a diminishing water supply regularly make the news. What most people might not know, yet just as devastating, is the potential effect of the 14-year drought in the Colorado River basin on the Southwests energy supplyhttp://thehill.com/opinion/op-ed/220075-congress-needed-on-water-power</HTML>
</details>
<commentary/>
<links>http://thehill.com/opinion/op-ed/220075-congress-needed-on-water-power</links>
<from/>
</section>
<section>
<title>* Global water level sensor industry explored in new report</title>
<details>
<HTML>CO: BlueField Research<br/><br/>AB: This report has introduced Water Level Sensor basic information included Water Level Sensor definition classification application industry chain structure industry overview.*</HTML>
</details>
<commentary/>
<links>http://www.whatech.com/market-research-reports/press-release/industrial/31670-global-water-level-sensor-industry-report-2014</links>
<from/>
</section>
</sections> |
Ma question est la suivante :
Pourquoi le texte de la deuxième section n'est pas entièrement repris?
Il manque le contenu suivant:
<p class="MsoNormal"><span style="font-size: 10.0pt">To access full report with TOC, please visit 2014 Market Research Report on Global Water Level Sensor Industry (http://www.reportstack.com/product/175905/2014-market-research-report-on-global-water-level-sensor-industry.html#src=whatech)</span></p>
Pouvez-vous svp m'aider à résoudre ce problème?
Merci pour votre aide.
Partager