?
Solved

Convert XML to pdf and\or doc

Posted on 2005-04-12
8
Medium Priority
?
595 Views
Last Modified: 2008-02-01
I don't work much with XML and am brand spanking new to java (never took a class, don't have any basics, I have worked with VB for years) and I have been asked to use InfoPath and VS .Net to convert XML files to pdf and doc format.  THus far I have figured out that I need to use XslTransform, but that is as far as I can figure.  Can anyone help me out with a code sample in javaScript to illustrate how this is done.  I woulod greatly appreciate it.  Thanks.
0
Comment
Question by:Wonderflub
  • 6
8 Comments
 
LVL 29

Expert Comment

by:bloodredsun
ID: 13761294
If you're using Java then you can use POI http://jakarta.apache.org/poi/index.html from jakarta to convert xml to things like Word and Excel files. You can create pdf's by using XSL-FO which is the standard way in XML.

here's a good general link http://blogs.msdn.com/dotnetinterop/archive/2005/03/04/385184.aspx
0
 

Author Comment

by:Wonderflub
ID: 13761560
I was asked ot use the built in functionality of VS .Net and office 2k3.  There isn't a simple way to do this using built in code?
0
 

Author Comment

by:Wonderflub
ID: 13765162
ok, how about a point in the right direction.  In my research I have found people say that I can't use xslTransform and I have to use msxml.  Is this true, should I be walking down this path instead.  This is all a lot for me to learn in a short amount of time and I htink my head is spinning, can anyone make it stop :-).

Seriously though, any help?
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:Wonderflub
ID: 13765235
WHat about this.....  would this work

<SCRIPT LANGUAGE="JScript">
var objDial = Server.CreateObject('Stonebroom.XSLTransform');
var strStatus;                            // to hold the status message
var strXMLFile = '/data/xml/myfile.xml';  // the XML source file
var strXSLFile = '/data/xsl/myfile.xsl';  // the XSL style sheet file
var strOutFile = '/results/myfile.doc';  // path and name for the resulting disk file
blnWorked = objTransform.TransformXML(strXMLFile, strXSLFile, strOutFile, strStatus);
Response.Write(strStatus);
</SCRIPT>

for at leas tthe doc file????
0
 
LVL 10

Accepted Solution

by:
BobSiemens earned 2000 total points
ID: 13773937
<<<for at leas tthe doc file????>>>

Nooooo.  

You need to look at what output types are generated by what XSLT engines.

Here's MSXSL:
<xsl:output
  method = "xml" | "html" | "text" | QName
  version = nmtoken
  encoding = string
  omit-xml-declaration = "yes" | "no"
  standalone = "yes" | "no"
  doctype-public = string
  doctype-system = string
  cdata-section-elements = QNames
  indent = "yes" | "no"
  media-type = string
  />


Here's Apache's FOP:
xslfo-fop

Render XSL:FO with Apache FOP rendering engine
Module
urn:org:ten60:netkernel:ext:xslfo
Definition
Format

<instr>
  <type>xslfo-fop</type>
  <operand>content.fo</operand>
  <operator>
    <xslfo-fop>
      <type>pdf</type>              <!--     <type> contains one of pdf, svg, pcl, awt, print, text, ps, mif, xml    -->
    </xslfo-fop>
  </operator>
  <target>this:response</target>
</instr>


DOC won't work but you can import HTML into a DOC file.

For a pdf file, you need to find the right transform engine.
0
 

Author Comment

by:Wonderflub
ID: 13781025
ok, so I HAVE to use FOP, I will have to try to figure out how to do that.

They have asked me to just create a generic transform engine that will automate the process, so I am no longer looking at one singular file, but many.  If the script language is JScript for the infopath forms, do I have to use Java, or can I create a transform engine in VB?
0
 

Author Comment

by:Wonderflub
ID: 13782884
ok, I am going to start a new question, since I am now asking more than one thing and diverting to a different direction.
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction In my previous article (http://www.experts-exchange.com/Microsoft/Development/MS-SQL-Server/SSIS/A_9150-Loading-XML-Using-SSIS.html) I showed you how the XML Source component can be used to load XML files into a SQL Server database, us…
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API (http://dictionary.reference.com/browse/API?s=t) has made its way into the popular lexicon of the English language.  A few years ago, …
In a question here at Experts Exchange (https://www.experts-exchange.com/questions/29062564/Adobe-acrobat-reader-DC.html), a member asked how to create a signature in Adobe Acrobat Reader DC (the free Reader product, not the paid, full Acrobat produ…
As many of you are aware about Scanpst.exe utility which is owned by Microsoft itself to repair inaccessible or damaged PST files, but the question is do you really think Scanpst.exe is capable to repair all sorts of PST related corruption issues?
Suggested Courses
Course of the Month16 days, 22 hours left to enroll

862 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question