472,980 Members | 2,083 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,980 software developers and data experts.

Transforming FixML using XSLT to a text file -strange output

1
I have added:

<br><xsl:value-of select="Line" /></br>

to my XSLT stylesheet to get a line per repeating block. When I view the output as XML it looks perfect - one line per block. However when I output the file to a text file, all the data is wrapping and at the end of each block I am getting the text part of the header included but not all of it. The text that appears is:

<br xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:user="urn:additional-functions" />

I have tried different variations of the <br> command above, but the text above keeps coming out.

So for example, I have three repeating blocks and each is ending with pipe, but the output comes out as follows
200809021005554|NEWM|BROKER|FUND52|09022008|200802 13|S|BRL|1000000|AUD|1564891|1.564891|
<br xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:user="urn:additional-functions" />200809021005554|NEWM|BROKER|FUND54|09022008|20080 213|S|BRL|2000000|AUD|3129782|1.564891|
<br xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:user="urn:additional-functions" />


the full XSLT is as follows. Apolgies in advance if it is really messy, I'm not a programmer (and at this rate probably never will be!). Thank you in advance for your help.

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:user="urn:additional-functions" xmlns:a="http://www.fixprotocol.org/FIXML-4-4" exclude-result-prefixes="a">
<xsl:output method="text" omit-xml-declaration="yes" indent="yes"/>
<xsl:variable name="tradecount">0</xsl:variable>

<xsl:template match="/">
<xsl:apply-templates select="/a:FIXML/a:AllocInstrctn" />
</xsl:template>

<xsl:template match="/a:FIXML/a:AllocInstrctn">


<xsl:for-each select="a:Alloc">


<!--unique reference made up of trade date and trade id-->
<xsl:value-of select="concat(substring(/a:FIXML/a:AllocInstrctn/@TrdDt,1,4),substring(/a:FIXML/a:AllocInstrctn/@TrdDt,9,2),substring(/a:FIXML/a:AllocInstrctn/@TrdDt,6,2))"/>
<xsl:value-of select = "/a:FIXML/a:AllocInstrctn/@ID2"/><!--new or cancel-->|NEWM|<xsl:value-of select="/a:FIXML/a:AllocInstrctn/a:Pty[@Src='B' and @R=1]/@ID"/>|<xsl:value-of select = "@Acct"/>|<xsl:value-of select="concat(substring(/a:FIXML/a:AllocInstrctn/@TrdDt,9,2),substring(/a:FIXML/a:AllocInstrctn/@TrdDt,6,2),substring(/a:FIXML/a:AllocInstrctn/@TrdDt,1,4))"/>|<xsl:choose>
<xsl:when test="@LinkTyp=1 and a:Instrmt/@ID='FORWARD'">
<xsl:value-of select="concat(substring(/a:FIXML/a:AllocInstrctn/@SettlDt2,1,4),substring(/a:FIXML/a:AllocInstrctn/@SettlDt2,6,2),substring(/a:FIXML/a:AllocInstrctn/@SettlDt2,9,2))"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat(substring(/a:FIXML/a:AllocInstrctn/@SettlDt,1,4),substring(/a:FIXML/a:AllocInstrctn/@SettlDt,6,2),substring(/a:FIXML/a:AllocInstrctn/@SettlDt,9,2))"/>
</xsl:otherwise>
</xsl:choose>|<xsl:choose>
<xsl:when test="@Side=1">
<xsl:text>B</xsl:text>
</xsl:when>
<xsl:otherwise>
<xsl:text>S</xsl:text>
</xsl:otherwise>
</xsl:choose>|<xsl:choose>
<xsl:when test="@Ccy=substring(/a:FIXML/a:Instrmt/@Sym,1,3 and @Side=1)">
<xsl:value-of select="substring(/a:FIXML/a:AllocInstrctn/a:Instrmt/@Sym,5,3)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring(/a:FIXML/a:AllocInstrctn/a:Instrmt/@Sym,1,3)"/>
</xsl:otherwise>
</xsl:choose>|<xsl:choose>
<xsl:when test="@Ccy='JPY'">
<xsl:value-of select="format-number(number(@Qty),'####')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="format-number(number(@Qty),'####.##')"/>
</xsl:otherwise>
</xsl:choose>|<xsl:choose>
<xsl:when test="@Ccy=substring(/a:FIXML/a:AllocInstrctn/a:Instrmt/@Sym,1,3 and @Side=1)">
<xsl:value-of select="substring(/a:FIXML/a:AllocInstrctn/a:Instrmt/@Sym,1,3)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="substring(/a:FIXML/a:AllocInstrctn/a:Instrmt/@Sym,5,3)"/>
</xsl:otherwise>
</xsl:choose>|<xsl:choose>
<xsl:when test="substring(a:Instrmt/@Sym,5,3)='JPY'">
<xsl:value-of select="format-number(number(@NetMny),'####')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="format-number(number(@NetMny),'####.##')"/>
</xsl:otherwise>
</xsl:choose>|<xsl:choose>
<xsl:when test="@LinkTyp=1 and a:Instrmt/@ID='FORWARD'">
<xsl:value-of select = "/a:FIXML/a:AllocInstrctn/@AvgPx2"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select = "/a:FIXML/a:AllocInstrctn/@AvgPx"/>
</xsl:otherwise>
</xsl:choose>|<xsl:value-of select="a:Stip[@Typ='TEXT']/@Val"/>
<xsl:value-of select="a:Pty[@Src='D' and @R=11]/@ID"/>

<xsl:text> </xsl:text>

<br/><xsl:value-of select="Line" /></br>
</xsl:for-each>


</xsl:template>
</xsl:stylesheet>
Feb 9 '08 #1
1 3402
jkmyoung
2,057 Expert 2GB
Change the exclude-result-prefixes attribute to exclude these namespaces.
exclude-result-prefixes="a msxsl user"
Feb 11 '08 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Xamalaek | last post by:
Hello, Is it possible to transform an XML document to a binary format using XSL? Can one use XSL-FO to do this? Regards, X
5
by: Jody Greening | last post by:
Transforming with XSLT, Grouping elements until difference found. I am seeking some help with the following problem, I am fairly new at XSLT transformations, and my problem may lie in looking at...
2
by: awilliam | last post by:
I'm using the BIE workflow engine and after querying an LDAP DSA I need to transform the XML response, which looks like - <?xml version="1.0" encoding="UTF-8" ?> <batchResponse...
4
by: Showjumper | last post by:
I am using the NITF DTD for my xml files and i need to use 2 xsl files to do the transform: one for the <body.head> and the second for the <body.content>. I've got this so far for transforming...
4
by: Cathie | last post by:
Hi All, I am trying to get my style sheet to work. It works fine in IE but I can't get it to work in .net. Below is the function I use for transforming, where advancedOptionsFile is the path...
4
by: John Bowman | last post by:
Hi, I'm not certain this is the best place to post this, but here it goes. I'm trying to get spaces to work correctly when using the WebBrowser control. Basically, I've got a valid XML...
0
by: Scott | last post by:
The following blog gives a neat example of how to transform directly into a node: http://blogs.msdn.com/xmlteam/ However, the code doesn't seem to work as it is presented in the blog. I have...
1
by: Krista Lemieux | last post by:
Hello, I am trying to transform XML with XSL to a string in .NET. Currently I am using XSLTransform class, but all the Transform() methods write to a file. How can I Transform it straight to a...
1
by: MaggotChild | last post by:
Hi, I'm trying to transform the values entered into a form: HTML: <div id="container"> <div id="bs"> <input id="name" type="text"/> <p>PPPPP</p> <a href="#" onclick="return transform()">Do...
1
by: scmorgan | last post by:
Hi All, I am trying to come up with a solution for transforming a complex type ie xml ... <document> <label> This is a <highlight> string</highlight> </label>
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
4
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.