Conversion to HL7

Here should go questions about transforming XML with XSLT and FOP.
Krishn60
Posts: 3
Joined: Wed Dec 24, 2008 7:01 pm

Conversion to HL7

Post by Krishn60 »

Hi

I am very new to conversion from XML and using Oxygen. I am trying to convert an XML file to HL7 format using XSLT. HL7 format is similar to a flat file with field/subfield/component/subcomponent delimeters that we use for Interface with external systems. Our sub component delimeter is "&". I tried using "&amp" instead of "&" and I am not getting the results that I want. Here is the code.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:template match="BABPQueueOBJs">
<xsl:for-each select="BABPQueueOBJ">
HSN|^~\&||||||||7|P
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

Here is what I am getting as an output - HSN|^~\&||||||||
Here is what I was expecting - HSN|^~\&||||||||

Let me know what I did wrong and how to correct it. Any help in this regard is greatly appreciated.

Thanks.
george
Site Admin
Posts: 2095
Joined: Thu Jan 09, 2003 2:58 pm

Re: Conversion to HL7

Post by george »

If you want to output text (not XML) add

<xsl:output method="text"/>

and the ampersand will not be serialized as & anymore.

Best Regards,
George
George Cristian Bina
Post Reply