IMPORTANT:
this is not a Support Forum! Experienced users might answer from time to time questions posted here. If you need a professional and reliable answer, or if you want to report a bug, please contact Altova Support instead.

Bug in generated c#? Options · View
rjswider
Posted: Tuesday, May 13, 2008 1:44:35 PM
Rank: Member

Joined: 3/18/2005
Posts: 6
Location: US
I've got a very simple Mapforce map that I'm using to generate c#. It's an xml-to-xml map. When I execute map.run() and save it to a file, it works fine. When I try using the OutputDocument object to return the document rather than saving it, it's empty. I stepped into the code, and the map works great, it just never sets the output document to the mapped result. I traced it to one of the included .cs files in the AltovaXML project included in the generated code. This copied straight out of the xmloperations.cs file in c:\program files\Altova\Mapforce2008\spl\cs\AltovaXML.


Code:
public static void SaveDocument(XmlDocument doc, Altova.IO.Output output, System.Text.Encoding encoding, bool prettyPrint)
        {
            switch (output.Type)
            {
                case Altova.IO.Output.OutputType.Stream:
                    SaveDocument(doc, output.Stream, encoding, prettyPrint);
                    break;

                case Altova.IO.Output.OutputType.Writer:
                    SaveDocument(doc, output.Writer, prettyPrint);
                    break;

                case Altova.IO.Output.OutputType.XmlDocument:
                    break; ;

                default:
                    throw new System.Exception("Unknown output type");
            }
        }


Notice the double semi-colon in the Altova.IO.Output.OutputType.XmlDocument case. Should that include a statement that assigns the value of doc to output.document? Or am I missing something else?

Rob
paul
Posted: Tuesday, May 27, 2008 9:38:48 AM
Rank: Advanced Member

Joined: 9/9/2005
Posts: 483
Location: AT
Hello,

Sorry, yes - the missing statement is a bug in the current version which should be fixed for the next release. Please accept our apologies for the inconvenience...
Users browsing this topic
guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Use of the Altova User Forum(s) is governed by the Altova Terms of Use.