How can I get the value of the mainbooktitle element in a DITA bookmap when the context is a topic or an image? - dita

When process images in DITA topics, I want to include the book title or the map title. Is that possible? How do I access the book title value in the XSLT context of an image?

How do I access the book title value in the XSLT context of an image?
Provided you are using DITA-OT HTML5 transformation for your HTML publishing, you can access map information from topic template by implementing three extension points described in Customizing DITA Open Toolkit.
dita.conductor.html5.param
dita.conductor.html5.toc.param
dita.xsl.html5
The sample plug-in structure, named "com.acme.html5.param" and "com.acme.html5":
dita-ot-3.3/plugins
|
+-- com.acme.html5.param
| |
| +-- plugin.xml
| buildHtml5Param.xml
|
+-- com.acme.html5
|
+-- plugin.xml
|
+--xsl
|
+-- dita2html5_acme_custom.xsl
[com.acme.html5.param/plugin.xml]
<?xml version="1.0" encoding="UTF-8"?>
<plugin id="com.acme.extend.html5.param">
<feature extension="dita.conductor.html5.param" file="buildHtml5Param.xml"/>
<feature extension="dita.conductor.html5.toc.param" file="buildHtml5Param.xml"/>
</plugin>
[com.acme.html5.param/buildHtml5Param.xml]
<?xml version="1.0" encoding="UTF-8"?>
<params xmlns:if="ant:if">
<param name="input.map.url" expression="${html5.map.url}" if:set="html5.map.url"/>
</params>
[com.acme.html5/plugin.xml]
<?xml version="1.0" encoding="UTF-8"?>
<plugin id="com.acme.html5">
<feature extension="dita.xsl.html5" file="xsl/dita2html5_acme_custom.xsl"/>
</plugin>
[com.acme.html5/xsl/dita2html5_acme_custom.xsl]
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:dita-ot="http://dita-ot.sourceforge.net/ns/201007/dita-ot"
exclude-result-prefixes="xs dita-ot"
version="2.0">
<!-- map URL -->
<xsl:param name="input.map.url" as="xs:anyURI" required="yes"/>
<!-- map document -->
<xsl:variable name="mapDoc" as="document-node()" select="doc($input.map.url)"/>
<!-- map title -->
<xsl:variable name="title" as="xs:string">
<xsl:variable name="titleTexts" as="xs:string*">
<xsl:choose>
<xsl:when test="$mapDoc/*[contains(#class,' bookmap/bookmap ')]">
<xsl:apply-templates select="$mapDoc/*[contains(#class, ' bookmap/bookmap ')]/*[contains(#class, ' bookmap/booktitle ')]/*[contains(#class, ' bookmap/mainbooktitle ')]" mode="dita-ot:text-only"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="$mapDoc/*[contains(#class, ' map/map ')]/*[contains(#class, ' topic/title ')]" mode="dita-ot:text-only"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:sequence select="string-join($titleTexts,'')"/>
</xsl:variable>
<!-- override image template -->
<xsl:template match="*[contains(#class, ' topic/image ')]" name="topic.image">
<!-- snip! -->
...
<!-- customization here! -->
<div>Map: <xsl:value-of select="$title"/></div>
</xsl:template>
</xsl:stylesheet>
By adding above plug-ins, you can get following sample result when building dita-ot-3.3/docsrc/samples/sequence.ditamap.
[dita-ot-3.3/docsrc/samples/sequence.ditamap]
<map>
<title>Working in the garage</title>
<topicref href="tasks/changingtheoil.xml" type="task"/>
...
<topicref href="tasks/washingthecar.xml" type="task"/>
...
</map>
[dita-ot-3.3/docsrc/samples/tasks/washingthecar.xml]

Related

XSLT - How to select the latest formatted date on condition of the attributes of 2 siblings

I was provided an xslt file recently to update and I have never used xslt before. I am trying to select the latest transaction date based on specific attributes of two siblings (ActionType and Status). How would I select a condition based on two siblings and return the date from that section?
I updated my with the provided code, but it's not working:
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0" xmlns:ms="urn:schemas-microsoft-com:xslt">
<xsl:output method="text" encoding="utf-8" />
<xsl:template match="/"><xsl:for-each select="SupplierConnectInvoice/Invoice | SupplierConnectInvoice/ImageInvoice">
Level1,,<xsl:if test="InvoiceHeader/InvoiceType = 'Original Invoice'">VO</xsl:if><xsl:if test="InvoiceHeader/InvoiceType = 'Credit Invoice'">AD</xsl:if>,<xsl:value-of select="InvoiceHeader/Partner[#PartnerType='Supplier']/Company/CompanyCode" />,<xsl:value-of select="ms:format-date(InvoiceHeader/InvoiceDate, 'MM/dd/yyy')" />,<xsl:value-of select="InvoiceHeader/InvoiceNumber" />,
<xsl:variable name="resubmitted" select="TransactionDateTime[preceding-sibling::ActionType[1]='Submit' and preceding-sibling::Status[1]='Re-Submitted']" as="xs:dateTime*"/>
<xsl:variable name="submitted" select="TransactionDateTime[preceding-sibling::ActionType[1]='Submit' and preceding-sibling::Status[1]='Submitted']" as="xs:dateTime*"/>
<xsl:choose>
<xsl:when test="count($resubmitted)">
<xsl:value-of select="format-dateTime(max($resubmitted),'[M01]/[D01]/[Y0001]')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="format-dateTime(max($submitted),'[M01]/[D01]/[Y0001]')"/>
</xsl:otherwise>
</xsl:choose>
Source Code
<?xml version="1.0" encoding="UTF-8"?>
-<SupplierConnectInvoice xmlns=" " type="A">
-<ImageInvoice id="150351390">
-<InvoiceHeader>
<InvoiceNumber>494022</InvoiceNumber>
+<Partner PartnerType="Supplier">
+<Partner PartnerType="Buyer">
<InvoiceDate>2018-12-11</InvoiceDate>
<InvoiceType>Original Invoice</InvoiceType>
<TransportClass>Supplier_Image_Direct</TransportClass>
<Total>1483.78</Total>
<SubmittedTotal>1483.78</SubmittedTotal>
<TotalLineItems>1</TotalLineItems>
<LongDescription>TM General Adv</LongDescription>
<CurrencyCode>CAD</CurrencyCode>
+<DocumentAction>
+<DocumentAction>
-<DocumentAction>
+<Person Role="DocumentActionPerformer">
<ActionType>Forward</ActionType>
<Status>Re-Submitted</Status>
<TransactionDateTime>2019-05-21T12:54:42</TransactionDateTime>
-<DocumentAction>
+<Person Role="DocumentActionPerformer">
<ActionType>Submit</ActionType>
<Status>Re-Submitted</Status>
<LongDescription>please see the amended</LongDescription>
<TransactionDateTime>2019-05-21T12:00:42</TransactionDateTime>
-<DocumentAction>
+<Person Role="DocumentActionPerformer">
<ActionType>Dispute</ActionType>
<Status>Disputed</Status>
<LongDescription>please change</LongDescription>
<TransactionDateTime>2019-05-21T08:44:46</TransactionDateTime>
-<DocumentAction>
+<Person Role="DocumentActionPerformer">
<ActionType>Submit</ActionType>
<Status>Submitted</Status>
<LongDescription>Uploaded on 05/17/2019 at 03:53:40 PM MDT</LongDescription>
<TransactionDateTime>2019-05-17T15:54:43</TransactionDateTime>
Expected results:
If there is ActionType = Submit & Status = Re-Submitted then 05/23/2019 (this would be the latest date of this combination)
If there is no Submit/Re-Submit (in other words ActionType = Submit & Status = Submitted) then 05/17/2019
Actual results is that the latest transaction date is pulled irrespective of the ActionType Status combination when I don't put in the max function.
I error out when the max function on the date
Please and thank you for your help!
This is difficult to understand.
Assuming that your input actually looks something like this:
XML
<DocumentAction>
<ActionType>Forward</ActionType>
<Status>Re-Submitted</Status>
<TransactionDateTime>2019-05-25T12:00:42</TransactionDateTime>
<ActionType>Submit</ActionType>
<Status>Re-Submitted</Status>
<TransactionDateTime>2019-05-23T12:00:42</TransactionDateTime>
<ActionType>Submit</ActionType>
<Status>Re-Submitted</Status>
<TransactionDateTime>2019-05-21T12:00:42</TransactionDateTime>
<ActionType>Submit</ActionType>
<Status>Submitted</Status>
<TransactionDateTime>2019-05-19T12:00:42</TransactionDateTime>
<ActionType>Submit</ActionType>
<Status>Submitted</Status>
<TransactionDateTime>2019-05-17T12:00:42</TransactionDateTime>
</DocumentAction>
you could use the following stylesheet:
XSLT 2.0
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xs">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/DocumentAction">
<xsl:variable name="resubmitted" select="TransactionDateTime[preceding-sibling::ActionType[1]='Submit' and preceding-sibling::Status[1]='Re-Submitted']" as="xs:dateTime*"/>
<xsl:variable name="submitted" select="TransactionDateTime[preceding-sibling::ActionType[1]='Submit' and preceding-sibling::Status[1]='Submitted']" as="xs:dateTime*"/>
<output>
<xsl:choose>
<xsl:when test="count($resubmitted)">
<xsl:value-of select="format-dateTime(max($resubmitted),'[M01]/[D01]/[Y0001]')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="format-dateTime(max($submitted),'[M01]/[D01]/[Y0001]')"/>
</xsl:otherwise>
</xsl:choose>
</output>
</xsl:template>
</xsl:stylesheet>
to return:
Result
<?xml version="1.0" encoding="UTF-8"?>
<output>05/23/2019</output>
which is the latest date whose ActionType = 'Submit' AND Status = 'Re-Submitted'.
Demo: https://xsltfiddle.liberty-development.net/3NJ38ZJ
If you remove these actions, so that the input is:
XML
<DocumentAction>
<ActionType>Forward</ActionType>
<Status>Re-Submitted</Status>
<TransactionDateTime>2019-05-25T12:00:42</TransactionDateTime>
<ActionType>Submit</ActionType>
<Status>Submitted</Status>
<TransactionDateTime>2019-05-19T12:00:42</TransactionDateTime>
<ActionType>Submit</ActionType>
<Status>Submitted</Status>
<TransactionDateTime>2019-05-17T12:00:42</TransactionDateTime>
</DocumentAction>
the result will be:
Result
<?xml version="1.0" encoding="UTF-8"?>
<output>05/19/2019</output>
which is the latest date whose ActionType = 'Submit' AND Status = 'Submitted'.
Demo: https://xsltfiddle.liberty-development.net/3NJ38ZJ/1
Added:
A more elegant version of the same idea:
XSLT 2.0
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
exclude-result-prefixes="xs">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/DocumentAction">
<xsl:variable name="resubmitted" select="TransactionDateTime[preceding-sibling::ActionType[1]='Submit' and preceding-sibling::Status[1]='Re-Submitted']" as="xs:dateTime*"/>
<xsl:variable name="submitted" select="TransactionDateTime[preceding-sibling::ActionType[1]='Submit' and preceding-sibling::Status[1]='Submitted']" as="xs:dateTime*"/>
<xsl:variable name="latest-dateTime" select="if (count($resubmitted)) then max($resubmitted) else max($submitted)"/>
<output>
<xsl:value-of select="format-dateTime($latest-dateTime,'[M01]/[D01]/[Y0001]')"/>
</output>
</xsl:template>
</xsl:stylesheet>

exsl:node-set not retrieving attribute's value

Here is a toned down version of my use case. I have
XSL file for transformation
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:exsl="http://exslt.org/common" extension-element-prefixes="exsl">
<xsl:output method="text"/>
<xsl:template match="Message">
<xsl:for-each select="ent">
<xsl:variable name="current_key" select="#key"/>
<xsl:variable name="current_type" select="#type"/>
<xsl:variable name="Match" select="exsl:node-set(msg)/ent"/>
<xsl:copy>
<xsl:copy-of select="exsl:node-set($Match)/#type"/>
<xsl:copy-of select="exsl:node-set($Match)/#key|exsl:node-set($Match)/translation/text()"/>
<!--- <xsl:copy-of select="exsl:node-set($Match)/#key|exsl:node-set($Match)/translation/text()|exsl:node-set($Match)/#type"/> Trial statement -->
</xsl:copy>
</xsl:for-each>
<xsl:call-template name = "Me" select="$Message"/>
</xsl:template>
</xsl:stylesheet>
And an input file as follows
<?xml version="1.0" encoding="utf-8"?>
<msg>
<ent key="key1" type="error">
<text>Error: Could not find </text>
<translation>Another Error similar to previous one.</translation>
</ent>
<ent key="key2" type="damage">
<text>Error2: Could not find2 </text>
<translation>Another Error2 similar to previous one.</translation>
</ent>
</msg>
I am using libXSLT in Perl as my transformation engine. My transformation script is already mentioned in this answer. Whenever I execute the script, I get the output as follows.
Error: Could not find
Another Error similar to previous one.
Error2: Could not find2
Another Error2 similar to previous one.
Why is the attribute type not getting printed? How do I retrieve it with the help of exsl:node-set or any other techniques? Also, can I include the attribute type in the trial statement in such a way that it will be in the output?
The following stylesheet:
XSLT 1.0
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text"/>
<xsl:template match="/msg">
<xsl:for-each select="ent">
<xsl:text>KEY: </xsl:text>
<xsl:value-of select="#key"/>
<xsl:text>
TYPE: </xsl:text>
<xsl:value-of select="#type"/>
<xsl:text>
TEXT: </xsl:text>
<xsl:value-of select="text"/>
<xsl:text>
TRANSLATION: </xsl:text>
<xsl:value-of select="translation"/>
<xsl:text>
</xsl:text>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
when applied to your input example, will produce:
KEY: key1
TYPE: error
TEXT: Error: Could not find
TRANSLATION: Another Error similar to previous one.
KEY: key2
TYPE: damage
TEXT: Error2: Could not find2
TRANSLATION: Another Error2 similar to previous one.

XSLT1.0 Add child element only once if does not exist

I am trying to add an element called Stamping one time and only if it doesn't exist in the message.
<!-- Copy all other elements -->
<xsl:template match="#*|node()">
<xsl:copy>
<xsl:apply-templates select="#*|node()" />
</xsl:copy>
<xsl:template match="/*[local-name()='Envelope']/*[local-name()='Body']/*/*[not(*[local-name()='Stamping'])]">
<xsl:copy>
<xsl:apply-templates select="#*|node()" />
</xsl:copy>
<v1:Stamping>
<v2:UserData CityCode="NO Stamping" Role="User" SecurityId="55"/>
</v1:Stamping>
</xsl:template>
My problem occurs because the new v1:Stamping value is repeated for every child like this based on my existing match:
<envelope>
<body>
<operationName>
<child1 Catalog="1" />
<v1:Stamping>
<v2:UserData CityCode="NO Stamping" Role="User" SecurityId="55"/>
<v1:Stamping>
<child2 Catalog="2" />
<v1:Stamping>
<v2:UserData CityCode="NO Stamping" Role="User" SecurityId="55"/>
</v1:Stamping>
</operationName>
</body>
</envelope>
I need to see the result where stamping is only added one time as a child element of operationName. operationName is an element that will exist but this XSLT will be applied across many services and the value in operationName will be different depending on the service where this XSLT will be applied. This example below would be the needed output.
<envelope>
<body>
<operationName>
<child1 Catalog="1" />
<child2 Catalog="2" />
<v2:UserData CityCode="NO Stamping" Role="User" SecurityId="55"/>
</operationName>
</body>
</envelope>
I need to see the result where stamping is only added one time as a
child element of operationName.
Then write a template especially for operationName elements:
<xsl:template match="operationName">
and check whether v1:Stamping already exists as one of its children:
<xsl:if test="not(v1:Stamping)">
If it does not exist already, it is added to the output tree.
Assuming the following XML, where there is no v1:Stamping element, as input:
XML Input
<?xml version="1.0" encoding="UTF-8"?>
<envelope>
<body>
<operationName>
<child1 Catalog="1"/>
<child2 Catalog="2"/>
</operationName>
</body>
</envelope>
Stylesheet
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:transform xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="2.0"
xmlns:v1="http://www.v1.com" xmlns:v2="http://www.v2.com">
<xsl:output method="xml" encoding="UTF-8" indent="yes" />
<xsl:strip-space elements="*"/>
<xsl:template match="#*|node()">
<xsl:copy>
<xsl:apply-templates select="#*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="operationName">
<xsl:copy>
<xsl:apply-templates select="#*|node()"/>
<xsl:if test="not(v1:Stamping)">
<v1:Stamping>
<v2:UserData CityCode="NO Stamping" Role="User" SecurityId="55"/>
</v1:Stamping>
</xsl:if>
</xsl:copy>
</xsl:template>
</xsl:transform>
XML Output
<?xml version="1.0" encoding="UTF-8"?>
<envelope>
<body>
<operationName>
<child1 Catalog="1"/>
<child2 Catalog="2"/>
<v1:Stamping xmlns:v1="http://www.v1.com" xmlns:v2="http://www.v2.com">
<v2:UserData CityCode="NO Stamping" Role="User" SecurityId="55"/>
</v1:Stamping>
</operationName>
</body>
</envelope>

How do we test whether a date is within 180 days from today in xslt in datapower

I am writing an xslt for datapower and in that I am getting a date(Payment Date).I have to check whether that date(Paymentt Date) is within 180 days of current date
I am getting present date by the following
<xsl:variable name="timestamp" select="date:date-time()"/>
Now how to check the condition for 180 days
Following is my xslt
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:dp="http://www.datapower.com/extensions"
xmlns:date="http://exslt.org/dates-and-times"
xmlns:dpconfig="http://www.datapower.com/param/config"
extension-element-prefixes="dp"
exclude-result-prefixes="dp dpconfig"
>
<xsl:output method="xml"/>
<xsl:template match="/">
<PaymentDate><xsl:value-of select="dp:http-request-header('X-payment-date')"/></PaymentDate> (From request I am getting payment date)
<xsl:variable name="timestamp" select="date:date-time()"/> (From here I am getting present date)
<xsl:if (this is what I am confused)
Thanks
Calculating date difference in XSLT 1.0:
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:date="http://exslt.org/dates-and-times"
extension-element-prefixes="date">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="/">
<output>
<difference>
<xsl:call-template name="date-difference">
<xsl:with-param name="date1" select="input/originalDate" />
<xsl:with-param name="date2" select="date:date-time()" />
</xsl:call-template>
</difference>
</output>
</xsl:template>
<xsl:template name="date-difference">
<xsl:param name="date1"/>
<xsl:param name="date2"/>
<xsl:param name="JDN1">
<xsl:call-template name="JDN">
<xsl:with-param name="date" select="$date1" />
</xsl:call-template>
</xsl:param>
<xsl:param name="JDN2">
<xsl:call-template name="JDN">
<xsl:with-param name="date" select="$date2" />
</xsl:call-template>
</xsl:param>
<xsl:value-of select="$JDN2 - $JDN1"/>
</xsl:template>
<xsl:template name="JDN">
<xsl:param name="date"/>
<xsl:param name="year" select="substring($date, 1, 4)"/>
<xsl:param name="month" select="substring($date, 6, 2)"/>
<xsl:param name="day" select="substring($date, 9, 2)"/>
<xsl:param name="a" select="floor((14 - $month) div 12)"/>
<xsl:param name="y" select="$year + 4800 - $a"/>
<xsl:param name="m" select="$month + 12*$a - 3"/>
<xsl:value-of select="$day + floor((153*$m + 2) div 5) + 365*$y + floor($y div 4) - floor($y div 100) + floor($y div 400) - 32045" />
</xsl:template>
</xsl:stylesheet>
When applied to the following input XML:
<input>
<originalDate>2013-09-15</originalDate>
</input>
The result will be:
<?xml version="1.0" encoding="UTF-8"?>
<output>
<difference>179</difference>
</output>
if the transformation is performed today, 2014-03-13.
IBM Datapower provides extension to existing EXSLT function. There is a function called 'difference' with following signature.
difference()
Returns the duration between the first date and the second date.
Syntax
date:difference(start-dateTime, end-dateTime)
You can utilize this function to find out the date-difference. For more information about extension function available in datapower see below link. Go to Chapter 5 and look for functions for manipulating 'date time'.
http://pic.dhe.ibm.com/infocenter/wsdatap/v3r8m1/topic/xm70/ExtensionFunctions.pdf
-Ajitabh
DataPower Supports Date:Difference
difference()
Returns the duration between the first date and the second date.
Syntax
date:difference(start-dateTime, end-dateTime)
You can pass current date as end-DateTime , date which wants to check as start-DateTime
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="xs"
xmlns:date="http://exslt.org/dates-and-times" version="1.0">
<!--<xsl:key name="lang" match="element" use="#language"></xsl:key>-->
<xsl:template match="/">
<xsl:variable name="date1" select="date:date-time()"/>
<xsl:variable name="date2" select="'2013-09-15'"/>
<output>
<difference>
<xsl:value-of select="translate(date:difference($date2, $date1),'PD','')"/>
</difference>
</output>
</xsl:template>
</xsl:stylesheet>

Convert XML Option element nodes to HTML Option tags

Is there a direct was to convert an Element Object to an HTMLOption Object?
Let's suppose I have this XML:
<?xml version='1.0'?>
<options>
<option value="1">Hello1</option>
<option value="2">Hello2</option>
</options>
I want to insert each option in this select
Is there a way to just convert these XML to option directly or I have to then navigate the XML then get all information I need and then create a new Option and add that option to the select?
something like:
var options = XmlCode.getElementsByTagName('option');
for(var i = 0; i < options.length; i++){
selectBox.add(options[i]);
}
as a native code would be nice ^^
Note: I don't want to use any libraries or frameworks. I want do learn and do this by myself.
XSLT is made for XML to HTML conversion. Something like this will do the trick:
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<?xml-stylesheet type="text/xsl" href="select2option.xml" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:html="http://www.w3.org/1999/xhtml"
>
<xsl:output method="html" encoding="utf-8" indent="yes" standalone="yes" media-type="text/html" omit-xml-declaration="yes" doctype-system="about:legacy-compat" />
<html:options>
<html:option name="foo">bar</html:option>
</html:options>
<xsl:template match="xsl:stylesheet">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="/">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
</head>
<body>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="html:options">
<select>
<xsl:apply-templates />
</select>
</xsl:template>
<xsl:template match="html:option">
<option name="#name">
<xsl:apply-templates />
</option>
</xsl:template>
</xsl:stylesheet>