Page 1 of 1

Conversion to HL7

Posted: Wed Dec 24, 2008 7:12 pm
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.

Re: Conversion to HL7

Posted: Thu Dec 25, 2008 10:36 am
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