Note that there are some explanatory texts on larger screens.

plurals
  1. POXSLT from 2 XMLs
    primarykey
    data
    text
    <p>i'm new to xslt advanced program. i actually have a doubt in making an xslt from 2 different xml files.</p> <p>Below are the 2 xml files i have.</p> <p><strong>AHK-authors.xml</strong></p> <pre><code> &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;chapters&gt; &lt;chapter no="1"&gt; &lt;head-4&gt;By J. R. Weeramantry&lt;/head-4&gt; &lt;/chapter&gt; &lt;chapter no="2"&gt; &lt;head-4&gt;By Ernest Yang&lt;footnote id="AHK-02.1.fn0" prefix="*"&gt; &lt;footnote-para&gt;I would like to acknowledge and express my gratitude for the assistance provided by my colleagues, Mr. Kevin Hong and Ms. Sharon Leung, in the preparation of this Chapter. All errors and omissions are my own. &lt;/footnote-para&gt; &lt;/footnote&gt; &lt;/head-4&gt; &lt;/chapter&gt; &lt;chapter no="3"&gt; &lt;head-4&gt;By David Bateson and Edmund Wan&lt;/head-4&gt; &lt;/chapter&gt; &lt;chapter no="4"&gt; &lt;head-4&gt;By Timothy Hill and Mark Lin&lt;/head-4&gt; &lt;/chapter&gt; &lt;chapter no="5"&gt; &lt;head-4&gt;By Christopher To&lt;footnote id="AHK-05.1.fn0" prefix="*"&gt; &lt;footnote-para&gt;I would like to acknowledge Alan Tang Siu Lun for his assistance in compiling parts of the Chapter.&lt;/footnote-para&gt; &lt;/footnote&gt; &lt;/head-4&gt; &lt;/chapter&gt; &lt;chapter no="6"&gt; &lt;head-4&gt;By Chiann Bao&lt;/head-4&gt; &lt;/chapter&gt; &lt;chapter no="7"&gt; &lt;head-4&gt;By Justin D’Agostino and Ula Cartwright-Finch&lt;/head-4&gt; &lt;/chapter&gt; &lt;chapter no="8"&gt; &lt;head-4&gt;By Kim M. Rooney&lt;/head-4&gt; &lt;/chapter&gt; &lt;chapter no="9"&gt; &lt;head-4&gt;By Neil Kaplan QC, JP, CBE, SBS and Andrew Aglionby&lt;/head-4&gt; &lt;head-5&gt;[Revised and Updated by William Stone QC, SBS]&lt;footnote id="AHK-09.1.fn0" prefix="*"&gt; &lt;footnote-para&gt;With thanks to summer students Chadwick Wong and Cheryl Leung.&lt;/footnote-para&gt; &lt;/footnote&gt; &lt;/head-5&gt; &lt;/chapter&gt; &lt;chapter no="10"&gt; &lt;head-4&gt;By Frances van Eupen&lt;/head-4&gt; &lt;/chapter&gt; &lt;chapter no="11"&gt; &lt;head-4&gt;By Peter Yuen and John Choong&lt;/head-4&gt; &lt;/chapter&gt; &lt;chapter no="12"&gt; &lt;head-4&gt;By David Bateson and Edmund Wan&lt;/head-4&gt; &lt;/chapter&gt; &lt;chapter no="13"&gt; &lt;head-4&gt;By Teresa Cheng SC&lt;footnote id="AHK-13.1.fn0" prefix="*"&gt; &lt;footnote-para&gt;Special thanks to Andrew Aglionby, Joy Medd and Johnson Tan, co-authors to the first edition of this chapter, as portions of their work has been retained herein.&lt;/footnote-para&gt; &lt;/footnote&gt; &lt;/head-4&gt; &lt;/chapter&gt; &lt;chapter no="14"&gt; &lt;head-4&gt;By Paul Starr&lt;footnote id="AHK-14.1.fn0" prefix="*"&gt; &lt;footnote-para&gt;Heartfelt thanks to Jennifer Lee-Shoy, Stefania Lucchetti, Samuel Tang and Rita Wong.&lt;/footnote-para&gt; &lt;/footnote&gt; &lt;/head-4&gt; &lt;/chapter&gt; &lt;chapter no="15"&gt; &lt;head-4&gt;By Timothy Hill and Mark Lin&lt;/head-4&gt; &lt;/chapter&gt; &lt;chapter no="16"&gt; &lt;head-4&gt;By Denis Brock and Shirley Wu&lt;/head-4&gt; &lt;/chapter&gt; &lt;chapter no="17"&gt; &lt;head-4&gt;By Peter Chow&lt;/head-4&gt; &lt;/chapter&gt; &lt;chapter no="18"&gt; &lt;head-4&gt;By Paul Starr&lt;footnote id="AHK-18.1.fn0" prefix="*"&gt; &lt;footnote-para&gt;Heartfelt thanks to Jennifer Lee-Shoy, Samuel Tang and Rita Wong for their assistance with this chapter.&lt;/footnote-para&gt; &lt;/footnote&gt; &lt;/head-4&gt; &lt;/chapter&gt; &lt;chapter no="19"&gt; &lt;head-4&gt;By Kathryn Sanger, Joseph Chu and Bing Yu&lt;/head-4&gt; &lt;/chapter&gt; &lt;chapter no="20"&gt; &lt;head-4&gt;By Loke-Khoon Tan&lt;/head-4&gt; &lt;/chapter&gt; &lt;chapter no="21"&gt; &lt;head-4&gt;By Philip Yang and Rosita Lau&lt;/head-4&gt; &lt;/chapter&gt; &lt;chapter no="22"&gt; &lt;head-4&gt;By Marianne Chao&lt;/head-4&gt; &lt;/chapter&gt; &lt;chapter no="23"&gt; &lt;head-4&gt;By Dr Nils Eliasson&lt;/head-4&gt; &lt;/chapter&gt; &lt;chapter no="24"&gt; &lt;head-4&gt;Banking, International Investor-State, Insurance, Property and Employment Disputes&lt;/head-4&gt; &lt;head-5&gt;By Frances van Eupen, Vincent Li, Gary Soo and Alexander Stock&lt;/head-5&gt; &lt;/chapter&gt; &lt;/chapters&gt; </code></pre> <p><strong>ARBHK-Chapter01.xml</strong></p> <pre><code> &lt;?xml version="1.0" encoding="UTF-8"?&gt; &lt;?xml-stylesheet type="xsl" ref="Untitled28.xslt"?&gt; &lt;chapter num="A"&gt; &lt;title&gt; &lt;content-style font-style="bold"&gt;PART 1 GENERAL PRINCIPLES&lt;/content-style&gt; &lt;/title&gt; &lt;section level="sect1"&gt; &lt;title&gt; &lt;content-style font-style="bold"&gt;Chapter 1: THE NEW ARBITRATION ORDINANCE&lt;/content-style&gt; &lt;/title&gt; &lt;/section&gt; &lt;/chapter&gt; </code></pre> <p>and the xslt i tried is as below <strong>Untitled28.xslt</strong></p> <pre><code>&lt;xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions"&gt; &lt;xsl:output method="html" encoding="UTF-8" indent="yes"/&gt; &lt;xsl:template match="/"&gt; &lt;html&gt; &lt;head&gt; &lt;xsl:text disable-output-escaping="yes"&gt;&lt;![CDATA[&lt;/meta&gt;]]&gt;&lt;/xsl:text&gt; &lt;title&gt; &lt;xsl:value-of select="substring-after(chapter/section/title,':')"/&gt; &lt;/title&gt; &lt;link rel="stylesheet" href="er:#css" type="text/css"/&gt;&lt;xsl:text disable-output-escaping="yes"&gt;&lt;![CDATA[&lt;/link&gt;]]&gt;&lt;/xsl:text&gt; &lt;/head&gt; &lt;body&gt; &lt;xsl:call-template name="new"/&gt; &lt;/body&gt; &lt;/html&gt; &lt;/xsl:template&gt; &lt;xsl:template match="chapters/chapter" name="new"&gt; &lt;div class="new"&gt; &lt;xsl:apply-templates select="document('AHK-authors.xml')/head-4"&gt; &lt;/xsl:apply-templates&gt; &lt;/div&gt; &lt;/xsl:template&gt; &lt;/xsl:stylesheet&gt; </code></pre> <p>the o/p i'm getting is as below</p> <pre><code>&lt;html&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=UTF-8"&gt; &lt;/meta&gt; &lt;title&gt; THE NEW ARBITRATION ORDINANCE&lt;/title&gt; &lt;link rel="stylesheet" href="er:#css" type="text/css"/&gt; &lt;/head&gt; &lt;body&gt; &lt;div class="new"/&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>but i want to list all the authors information.</p> <p>please let me know how do i do it.</p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload