Radiobuttons in XML / XSL

Questions about XML that are not covered by the other forums should go here.
Posts: 4

Radiobuttons in XML / XSL

Fri Apr 04, 2014 2:37 pm

First: Sorry, my english is not the best, but I try to write as good as possible.

My Path in .XML file:

Code: Select all


If in .XML file in

Code: Select all


is a "yes", then the result should be:

yes (radiobutton=checked) (radiobutton) no

If in .XML in

Code: Select all


is a "no", then the result should be:

yes (radiobutton) (radiobutton=checked) no

In my .XSL file it looks like this as far:

Code: Select all

<xsl:variable name="rezeptgebbefr">

<xsl:when test="/n1:ClinicalDocument/n1:recordTarget/n1:patientRole/n1:rezeptgebuehrenbefreiung">

<xsl:value-of select="/n1:ClinicalDocument/n1:recordTarget/n1:patientRole/n1:rezeptgebuehrenbefreiung"/>





I don't know how I get the radiobuttons to the correct place. I tried different solutions of Google, but they also don't work.

Maybe somebody can help me! Thank you very much!

Greetings, Mario
Posts: 77

Re: Radiobuttons in XML / XSL

Sat Apr 05, 2014 6:40 am

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<n1:ClinicalDocument xmlns:n1="localhost">

Code: Select all

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="" xmlns:xs=""
    xmlns:n1="localhost" exclude-result-prefixes="xs" version="1.0">
    <xsl:output method="html"/>
    <xsl:template match="/">
                <form action="">
                    <xsl:if test="/n1:ClinicalDocument/n1:recordTarget/n1:patientRole/n1:rezeptgebuehrenbefreiung='yes'">
                        <xsl:text disable-output-escaping="yes">&lt;input type="radio" name="answer" value="yes" checked>Yes</xsl:text>
                        <xsl:text disable-output-escaping="yes">&lt;input type="radio" name="answer" value="no">No</xsl:text>
                    <xsl:if test="/n1:ClinicalDocument/n1:recordTarget/n1:patientRole/n1:rezeptgebuehrenbefreiung='no'">
                        <xsl:text disable-output-escaping="yes">&lt;input type="radio" name="answer" value="yes">Yes</xsl:text>
                        <xsl:text disable-output-escaping="yes">&lt;input type="radio" name="answer" value="no" checked>No</xsl:text>

Return to “General XML Questions”

Who is online

Users browsing this forum: No registered users and 1 guest