Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi there..

I am trying to create a xslt document via XML. In my XML I have the below text
HTML
<Section ExcludedFromGPCopy="false" ExcludedFromPatientCopy="false" Name="PrimaryDischargeDiagnosis" PrintSectionTitle="true" RichText="false" Title="Primary Discharge Diagnosis"><TextObservation><TextType>PrimaryDischargeDiagnosis</TextType><TextValue> Accidental puncture/laceration during procedure&#xd;
·Anaemia - Iron deficiency secondary to blood loss&#xd;
·CAL/COPD (Chronic Airways Limitation) due to harmful smoking&#xd;
·Suspected deep tissue injury, depth unknown
</TextValue><FormRequestId>0</FormRequestId></TextObservation></Section>


Which I would like to convert into XSLT by adding a line break after the &#xd;
My current XSLT code for this is :
XML
<fo:table-row>
        <fo:table-cell padding="2pt" border-width="0.5pt" border-style="solid">
            <xsl:choose>
                <xsl:when test="PrescriptionMessage/Section[@Title='Primary Discharge Diagnosis']/TextObservation[TextType='PrimaryDischargeDiagnosis']/TextValue != ''">
                    <fo:block white-space-collapse="true" white-space-treatment="preserve" linefeed-treatment="preserve" space-before="0mm" space-after="0mm">
                        <fo:inline>
                            <xsl:value-of select="PrescriptionMessage/Section[@Title='Primary Discharge Diagnosis']/TextObservation[TextType='PrimaryDischargeDiagnosis']/TextValue" />
                        </fo:inline>
                    </fo:block>
                </xsl:when>
                <xsl:when test="PrescriptionMessage/Section[@Title='Primary Discharge Diagnosis']/StructuredFormData/Title = 'PrimaryDischargeDiagnosis'">
                    <xsl:for-each select="PrescriptionMessage/Section[@Title='Primary Discharge Diagnosis']/StructuredFormData/AtomicObservation">
                        <fo:block>
                            <xsl:value-of select='AtomicObservationName' />
                        </fo:block>
                        <xsl:for-each select="AtomicObservation">
                            <fo:block margin-left="9pt">
                                <xsl:value-of select='AtomicObservationName' />
                            </fo:block>
                            <xsl:for-each select="AtomicObservation">
                                <fo:block margin-left="18pt">
                                    <xsl:value-of select='AtomicObservationName' />
                                </fo:block>
                            </xsl:for-each>
                        </xsl:for-each>
                    </xsl:for-each>
                </xsl:when>
                <xsl:otherwise>
                    <fo:block font-style="italic">
                        None
                    </fo:block>
                </xsl:otherwise>
            </xsl:choose>
        </fo:table-cell>
    </fo:table-row>


What can I use in XSLT to perform the line break ?

What I have tried:

I have not tried many options at this stage.
Posted
Updated 7-Feb-18 13:16pm
Comments
PIEBALDconsult 7-Feb-18 19:17pm    
I'm not sure I follow you -- you want to use XSLT to transform XML to XSLT ?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900