Tags not printed when outputting XML after XSLT transformation

Hi!
I want my to perform an XSLT transformation on requests to my web service.
This is the style of a typical request:
<app:aRequest xmlns:app="http://myNamespace">
  <app:firstTag>value1</app:firstTag>
  <app:secondTag>value2</app:secondTag>
  <app:thirdTag>value3</app:thirdTag>
</app:aRequest>I want to transform it into something like this:
<app:aRequest xmlns:app="http://myNamespace">
  <app:firstTag>A hard coded, completely different value!</app:firstTag>
  <app:secondTag>value2</app:secondTag>
  <app:thirdTag>value3</app:thirdTag>
</app:aRequest>To do that, I use the following XSLT:
<?xml version="1.0" encoding="ISO-8859-1"?>
<xsl:stylesheet version="1.0"
                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
                xmlns:app="http://myNamespace">
<xsl:template match="/">
<app:aRequest>
  <app:firstTag>A hard coded, completely different value!</app:firstTag>
  <app:secondTag><xsl:value-of select="app:aRequest/app:secondTag" /></app:secondTag>
  <app:thirdTag><xsl:value-of select="app:aRequest/app:thirdTag" /></app:thirdTag>
</app:aRequest>
</xsl:template>
</xsl:stylesheet>And I use the following code to execute the transformation:
public Object unmarshal(Source source) throws XmlMappingException, IOException {
  TransformerFactory factory = TransformerFactory.newInstance();
    // Does this factory support SAX features?
    if(factory.getFeature(SAXSource.FEATURE)) {
      SAXTransformerFactory saxTransformerFactory = (SAXTransformerFactory)factory;
    // Read xslt file.
    InputStream inputStream = getClass().getResourceAsStream("/META-INF/xsltTransformation.xsl");
    if(inputStream == null) {
      throw new RuntimeException("No XSLT transformation file present at " + location);
    Templates xsltOutputTemplate = saxTransformerFactory.newTemplates(new StreamSource(inputStream));
    Transformer transformer = xsltTemplate.newTransformer();
    // Perform transformation.
    StringWriter stringWriter = new StringWriter();
    StreamResult result = new StreamResult(stringWriter);
    transformer.transform(source, result);
    // Print result.
    String xmlString = stringWriter.toString();
    System.out.println(xmlString);
    // Proceed with unmarshalling.
    StringReader stringReader = new StringReader(xmlString);
    StreamSource transformedSource = new StreamSource(stringReader);
    return oxMapper.getUnmarshaller().unmarshal(transformedSource);
}However, the System.out.println(xmlString); produces the following result:
<?xml version="1.0" encoding="UTF-8"?>
  value1
  value2
  value3The tags are not printed and the hard coded value is not present.
What am I doing wrong? Please help!

Following up on what the good Dr said,
Are you sure that you are using the stylesheet that you think you are?
I tried your stylesheet and input and got more or less what you wanted and not what you actually got.
Note that I did not use your code.

Similar Messages

  • Some paragraph tags are not printing when document is printed from Framemaker 10.

    So this is really odd. I have a situation where I have a document that I am developing in Framemaker 10 several different paragraph tags are intermittently not printing when the document is physically printed. When I go to print the document from Framemaker 10 to a physical piece of paper some tags are printing partially or not at all. What makes this stranger to me is that when I print the document to a PDF, all of the content and tags show up in the PDF. Then when I try to physically print from the PDF, the tags do no print from that document as well.
    Typically the tags that are not printing are those that have been bolded, but are across several different tags. Also the problem is sometimes only to the first line of a tag, where if the tag carries over to a second line in the document, the text on the second line prints. Another quirky instance that shows up is where the text a line will print only parts of the text. The document uses the same type font for the entire document, Helvetica 55 Roman. The font size varies and the coloring varies as well, but this issue is happening for all sizes and colors.
    I'm not sure what additional information is important here, but if you need additional information please request it and I will supply it to the best of my ability. I'm a content developer with an intermediate amount of experience with Framemaker.

    I'm not sure if this is the same problem, and you didn't mention your
    OS, but there was a widespread problem with dropped text in PDF with
    Windows XP. A hotfix was issued to fix it. If on Windows XP, you should
    install it:
    http://blogs.adobe.com/techcomm/2008/07/hotfix_for_framemaker_1.html
    Also, you mentioned that it was "bolded" text that tended to have the
    problem. Bolded text is artificially bold and does not use actual bold
    fonts. (If I recall, text is double printed at a slight offset to give
    the appearance of a bold font.) So there is no bold font to embed. Be
    sure you install and use an actual bold font, rather than using the
    bolded characteristic, or you could see problems.
    This is a stretch, but you also mentioned that some of the problem
    sections have colored text. Check the printer properties of your Adobe
    PDF virtual printer to make sure someone didn't reassign the driver (on
    the Advanced tab). It should be set to use the Adobe PDF Converter
    driver (or Acrobat Distiller in older Acrobat versions). Years ago,
    people sometimes changed this setting to use other drivers for various
    reasons, not realizing that they limited themselves to the capabilities
    of that driver. So, if they chose an HP LaserJet PostScript driver, for
    example, their documents might no longer be able to be 11"x17" or
    color-- because the printer couldn't handle it. The driver was limited
    to 8.5"x14" and black-and-white. Perhaps there is a driver set that is
    choking on the colored text-- though I would think it would merely
    convert it to B&W.
    Okay, I've grasped at enough straws.

  • Error TaskServerIP tag not found in Task XML - 11.3.1 FTF 1

    Hi, I created long ago a preboot bundle which install a VHD folder. It was created under 11.2.3a if I remember correctly. It always works until now. Now, under ZENworks 11.3.1 FTF 1 when I configure my workstation to use this preboot bundle all I get is an error saying "Error: Task `ServerIP` tag not found in Task XML". If under the maintenance mode in the PXE I click F9 (Query for Work) again then I get "No work to do". And we have only 1 server at the moment! So what am I missing here? Anyone else have this problem?
    Thanks in advance for the help!
    GuillaumeBDEB

    Originally Posted by shaunpond
    GuillaumeBDEB,
    I'm guessing that something's got broken with the bundle - why not try
    exporting and importing to a new bundle, see if anything's missing?
    Shaun Pond (now working for ENGL)
    newly reminted as a Knowledge Professional
    Problem solved. One of our tech pushed a new zmg file on the server and forgot to update the preboot bundle. It would have been more useful if the error message was less cryptic.
    Thanks anyway for the help!
    GuillaumeBDEB

  • How to retain prolog in output xml after parse the input xml

    Hi,
    I am using com.bea.xml.XmlObject.Factory.parse(String) method to parse a xml.
    Input XML is having prolog defore the root node.But after parse the xml using the above method, the prolog is not there in the Output XML.
    can any one help me to retain the prolog in Output XML as it is in Input XML......
    Thanks in advance..
    Regards,
    Deba

    Hi,
    The Input XML is like
    <?xml version="1.0" encoding="UTF-8"?>
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
         <SOAP-ENV:Body>
         </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    But after parse the Output XML become
    <SOAP-ENV:Envelope xmlns:SOAP-ENV="http://schemas.xmlsoap.org/soap/envelope/" xmlns:SOAP-ENC="http://schemas.xmlsoap.org/soap/encoding/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
         <SOAP-ENV:Body>
         </SOAP-ENV:Body>
    </SOAP-ENV:Envelope>
    But due to project requirement i want to keep the prolog(<?xml version="1.0" encoding="UTF-8"?>) as it is with Output XML after parse the xml.
    can i use any XMLOption while calling parse() method...Or any one have any otherway to retain prolog after parse ?
    please help me to get it .
    Thanks in advance.
    Regards,
    Deba

  • My hp deskjet 1510 series does not print when connected to my hplap top (windows Vista),

    My hp deskjet 1510 series does not print when connected to my hp lap top (windows Vista), it says the printer is not active, although it is default printer, connected and on. However, it does work when connected to the (also HP) lap top (windows 8) of my husband.  I did everything the hp print and scan doctor advised and also what I could find at HP support (like switch of fire walls, reinstall everything, check printpooler ec etc)... it still does nothing except that I managed to print a diagnostic print which should give information about the condition,  but it only gives numbers and letters like : 11. SN = [Edited for Personal Information] Yr  12 PER = 05YR etc, that does not really help me :-). It won't print any testpages.  H E L P!!!

    Hello Elisabeeth,
    Welcome to the HP Forums!
    I understand you're unable to print using the Deskjet 1510. I will do my best to assist you! When you reinstall the HP software, did the installation state it was complete?
    I would start off by following this HP document on 'Printer is offline' Message Displays on the Computer and the Printer Will Not Print. From this document, please make sure you check the connection type and the ports.
    Please post your results, as I will be looking forward to hearing from you.
    I worked on behalf of HP.

  • I use floating time zone with all of my iCal entries.  But then the times of the entries do not print when printing month view.  Is there a fix for this?

    I use floating time zone with all of my iCal entries.  But then the times of the entries do not print when printing month view.  Is there a fix for this?

    Sorry to have repeated this question as if I were answering it.  Just a mistake.  I'm just now learning how to use this site.

  • HP 5510 wil not print in black ink after installing a new black ink cartridge

    My HP 5510 printer will not print in black ink after installing an official HP black ink cartridge.  I see other people have had the same problem.  I have gone through all the troubleshooting suggestions.  
    I would like to know if anyone has been able to fix this problem.  I just spend money on a new XL cartridge.  Any help/suggestions would be appreciated. 

    Hi @obxgirl,
    Welcome to the HP Support Forums! I see you are running into some print quality issues on your HP Photosmart 5510, you are unable to print in black ink.
    I would like you to continue here: Printer Does Not Print Black Ink or Color Ink, or Prints Blank Pages, I understand you may have done some of these steps already but I need you to complete all steps in order to resolve the missing black issue you are experiencing.
    Please note: There are three printhead cleaning stages. Complete all three stages if necessary. If the printhead is badly clogged, it might require another cleaning cycle. If so, wait 30 minutes after the last (third) cleaning stage to start the first stage of the cleaning process over again.
    If you are still unable to print in black ink, I suspect the issue may be the printer and not the cartridge. Please let me know which Country/Region you are in as well as the product Warranty status: HP Warranty Checker
    I hope to hear from you soon.
    Thanks,
    HevnLgh
    I work on behalf of HP
    Please click “Accept as Solution” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" to the left of the reply button to say “Thanks” for helping!

  • HELP"apple application support not found when installing itunes after a hard drive crash and replace

    HELP"   error "apple application support not found" when downloading itunes after a hard drive crash and replacement????

    Let's try a standalone Apple Application Support install. It still might not install, but fingers crossed any error messages will give us a better idea of the underlying cause of the issue.
    Download and save a copy of the iTunesSetup.exe (or iTunes64setup.exe) installer file to your hard drive:
    http://www.apple.com/itunes/download/
    Download and install the free trial version of WinRAR:
    http://www.rarlab.com/
    Right-click the iTunesSetup.exe (or iTunes64Setup.exe), and select "Extract to iTunesSetup" (or "Extract to iTunes64Setup"). WinRAR will expand the contents of the file into a folder called "iTunesSetup" (or "iTunes64Setup").
    Go into the folder and doubleclick the AppleApplicationSupport.msi to do a standalone AAS install.
    Does it install properly for you? If so, does iTunes launch properly now?
    If instead you get an error message during the install, let us know what it says. (Precise text, please.)

  • FormCentral PDF export: Drop-Down Menu does not print when no choice is made

    FormCentral PDF export: Drop-Down Menu does not print when no choice is made
    I want to be able to print a blank form for the older clients who cannot use a computer. Form has a few drop-down menus and they only appear on the print out if an option is selected. The form was created on FormCentral. Can anybody help?
    Sorry if i'm a noob, not much experience in creating PDF forms yet.
    Thanks for your help,
    Yon

    Hi Perry
    I am using the trial version of Adobe Acrobat and am using the provided FormCentral software to create the form. I find it very limited, but easier to learn. I am creating a financial needs analyser.
    The section of the drop down menu is a selection from 1-5 (rating of importance for financial goals). I want to print out the questions and the empty boxes for people to fill them in by hand (e.g write 1, 2, 3, 4, or 5). When I leave a blank choice, no box is printed out. I write the questions in formatted text and leave the text/caption for the drop-down as blank, as it is difficult to set the margins correctly so various elements align (I pretty much have to estimate).
    As said before, I may have been missing a massive part of the software, but I haven't used any training - just going by instinct so far.
    Do you know if I can do anything about it?
    Thanks,
    Yon

  • Image not printed in SapScript, only after page break

    Hi,
    I have a problem in printing an image (stored as text) in a sapscript. The image was uploaded correctly from a TIF file in tcode SE78. The image contains a signature and I need to print it at variable positions within the form. That is I need to print it in the MAIN window. The image does not get printed when a page break occurs when outputing the text element containing the picture. If the page break occurs when outputing any (other) text, the image is printed correctly (after that text).
    Has anybody else encountered this problem? Could it be a sapscript bug?
    Thx in advance.
    Claudiu

    >
    > Looks like the last page is not called !!! I can see data only on one page and it shows page 1 of 1.
    >
    > "make sure ST_TEMP is filled with data" how do I do this ?? My program line node has the data filled in the internal table it_temp and the loop node has the data transferred to st_temp for every row. How can I debug the program lines code ??
    > > Have a break <username> in the program lines. and check it_temp has data in it.
    > "use a command and call the last page at end of the loop on internal table"...how to do this ?
    > > like program lines there is a "command line" do a little search on SDN for more info on how to use command lines for next page.
    >

  • Out put file is not genrated when calling xml reports from OAF page

    Dear all
    i am calling xml reports from OAF page
    the out put file is not generated
    i am writing this code
    public int tradingrequest(String quoid, String costoder,int orgid)
    try
    OADBTransaction tx = (OADBTransaction)getOADBTransaction();
    java.sql.Connection pConncection = tx.getJdbcConnection();
    ConcurrentRequest cr = new ConcurrentRequest(pConncection);
    String applnName =
    "XXCRM"; //Application that contains the concurrent program
    String cpName = "XXCRM_COSTSHEET"; //Concurrent program short name
    String cpDesc =
    "Trading Costsheet Report XXCRM"; // concurrent Program description
    Number orgid1=new Number(orgid);
    // Pass the Arguments using vector
    Vector cpArgs = new Vector();
    cpArgs.addElement(quoid);
    cpArgs.addElement(costoder);
    cpArgs.addElement(orgid1.toString());
    // Calling the Concurrent Program
    int requestId =
    cr.submitRequest(applnName, cpName, cpDesc, null, false, cpArgs);
    tx.commit();
    System.out.println("Request ID is " + requestId);
    return requestId;
    } catch (RequestSubmissionException e)
    OAException oe = new OAException(e.getMessage());
    oe.setApplicationModule(this);
    throw oe;
    in controller i am writing this code
    OAMessageStyledTextBean y =
    (OAMessageStyledTextBean)webBean.findChildRecursive("quotationid");
    OAFormValueBean z =
    (OAFormValueBean)webBean.findChildRecursive("costorder");
    String quoid = y.getValue(pageContext).toString();
    String costorder = z.getValue(pageContext).toString();
    System.out.println("The quotation id and costing order are....." + quoid +
    " " + costorder);
    /*if click on run report button to run the report*/
    if ("Viewreport".equals(pageContext.getParameter(EVENT_PARAM)))
    if (tsflag.equals("Y"))
    int requestid = am.servicerequest(quoid, costorder, orgid);
    String url =
    "OA.jsp?akRegionCode=FNDCPREQUESTVIEWPAGE&akRegionApplicationId=0&retainAM=Y&addBreadCrumb=Y&REQUESTID=" +
    requestid;
    pageContext.setForwardURL(url, null,
    OAWebBeanConstants.KEEP_MENU_CONTEXT, null,
    null, true,
    OAWebBeanConstants.ADD_BREAD_CRUMB_YES,
    OAWebBeanConstants.IGNORE_MESSAGES);
    when i call the report from oaf page the request id is coming
    when i click on view output i am getting this message
    Error
    The concurrent request 7335031 did not create an output file.
    WHEN I GOTO FIND REQUESTS PAGE QUERY THIS REQUEST ID I AM GETTING THE OUTPUT IN XM FILE
    Regards
    Sreekanth

    java.io.FileNotFoundException: \..\..\..\xdoAqdFFZfuuJ051010_0628487460.fo (The system cannot find the path specified)
    MY CO code
    if("GenerateReport".equals(event))
    // Get the HttpServletResponse object from the PageContext. The report output is written to HttpServletResponse.
    DataObject sessionDictionary = (DataObject)pageContext.getNamedDataObject("_SessionParameters");
    HttpServletResponse response = (HttpServletResponse)sessionDictionary.selectValue(null,"HttpServletResponse");
    try {
    // Hashtable hashtable = new Hashtable(1);
    // hashtable.put("TruckBookingRefNum",trucknum);
    // System.out.println("test"+trucknum);
    ServletOutputStream os = response.getOutputStream();
    // Set the Output Report File Name and Content Type
    String contentDisposition = "attachment;filename=LF Cargo Summary Report.htm";
    response.setHeader("Content-Disposition",contentDisposition);
    response.setContentType("application/HTML");
    // Get the Data XML File as the XMLNode
    XMLNode xmlNode = (XMLNode) am.invokeMethod("getTestDataXML");
    ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
    xmlNode.print(outputStream);
    ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
    ByteArrayOutputStream pdfFile = new ByteArrayOutputStream();
    System.out.println(" ByteArrayInputStream.ByteArrayOutputStream"+pdfFile+inputStream);
    //Generate the PDF Report.
    TemplateHelper.processTemplate(
    ((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getAppsContext(),
    "LFCUST",
    "XXLFCARSUM_TARGET",
    "English",//((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getLanguage(),
    "US",//((OADBTransactionImpl)pageContext.getApplicationModule(webBean).getOADBTransaction()).getUserLocale().getCountry(),
    inputStream,
    TemplateHelper.OUTPUT_TYPE_HTML,
    null,
    pdfFile);
    // hashtable);
    System.out.println(" TemplateHelper");
    // Write the PDF Report to the HttpServletResponse object and flush.
    byte[] b = pdfFile.toByteArray();
    System.out.println(" byte"+b);
    response.setContentLength(b.length);
    os.write(b, 0, b.length);
    os.flush();
    os.close();
    pdfFile.flush();
    pdfFile.close();
    catch(Exception e)
    System.out.println(" inside catch");
    response.setContentType("text/html");
    throw new OAException(e.getMessage(), OAException.ERROR);
    pageContext.setDocumentRendered(true);
    Edited by: user9367919 on May 13, 2010 10:31 AM

  • PrintDataGrid's DataGridColumn - Embedded image not printing when you use TextFlow in the item rende

    I'm printing a datagrid using something like  this...
    <mx:PrintDataGrid
      id="printDataGrid" 
      width="100%" 
      height="100%"
      showHeaders="false"
      borderVisible="false"
      horizontalGridLines="false"
      variableRowHeight="true"
      dataProvider="{titles}"
      >
      <mx:columns>
       <mx:DataGridColumn 
        itemRenderer="renderer.TitlePrintRenderer" 
        />
      </mx:columns>
    </mx:PrintDataGrid>
    TitlePrintRenderer.mxml has s:RichText component. I use  RichText's textFlow property to render the text. The approach is working fine  except that if the textFlow has embedded images (<img source=... />), the  images are not printed!
    Is this a bug? Is it a limitation? Has anyone come  across this issue?
    I'm using Flex SDK 4.5.1

    After struggling for 4+ days on using timer / events for printing PrintDataGrid with embedded images in RichText's textFlow, I tried your other suggestion... to convert <img> tags to InlineGraphicElement and give it Bitmap from image loaded from a .gif file. The approach works but the printout skips images in a few rows!
    I've this test case in which, every time I print, it skips printing image in the second row! I also implemented this approach in a more complex test case and depending on the total number of rows, it would skip printing image in different number of rows. I'm suspecting that even if you construct InlineGraphicElement from bitmap loaded from an image, PrintDataGrid's renderer still skips printing image intermittently.
    I would very much appreciate it if you could create small project from my following code and verify this behavior. I'm at my wit's end in getting this printing to work.
    PrintImagesTest.mxml
    =================
    <?xml version="1.0" encoding="utf-8"?>
    <s:Application
        xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/mx"
        minWidth="955" minHeight="600"
        initialize="initData();"
        viewSourceURL="srcview/index.html"
        >
        <s:layout>
            <s:VerticalLayout
                paddingLeft="20" paddingRight="20"
                paddingTop="20" paddingBottom="20"
                />
        </s:layout>
        <mx:Button
            label="Print"
            click="printClickHandler();"
            />
        <fx:Script>
            <![CDATA[
                import flash.utils.setTimeout;
                import flashx.textLayout.elements.InlineGraphicElement;
                import flashx.textLayout.elements.ParagraphElement;
                import flashx.textLayout.elements.SpanElement;
                import flashx.textLayout.elements.TextFlow;
                import mx.collections.ArrayCollection;
                import mx.printing.*;
                import mx.utils.OnDemandEventDispatcher;
                public var contentData:ArrayCollection;
                private var embeddedImages:ArrayCollection;
                private var numberOfImagesLoaded:int;
                public var printJob:FlexPrintJob;
                public var thePrintView:FormPrintView;
                public var lastPage:Boolean;
                private var textFlowNS:Namespace = new Namespace("http://ns.adobe.com/textLayout/2008");
                public function initData():void {
                    contentData = new ArrayCollection();
                    var page:int = 0;
                    for (var z:int=0; z<20; z++)    {
                        var content:Object = new Object();
                        content.srNo = z+1;
                        content.contentText =
                        "<TextFlow whiteSpaceCollapse='preserve' xmlns='http://ns.adobe.com/textLayout/2008'>" +
                        "<span>some text</span>" +
                        "<img width='53' height='49' source='assets/images/formula.gif'/>" +
                        "</TextFlow>";
                        contentData.addItem(content);
                public function printClickHandler():void {
                    convertToTextFlow();
                private function convertToTextFlow():void {
                    embeddedImages = new ArrayCollection();
                    numberOfImagesLoaded = 0;
                    for each (var contentElement:Object in contentData) {
                        extractImageInfo(contentElement.contentText);
                    if (embeddedImages.length > 0) {
                        loadImage(embeddedImages.getItemAt(0).source);
                    } else {
                        printData();
                private function extractImageInfo(contentText:String):void {
                    var textXml:XML = new XML(contentText);
                    var imageList:XMLList = textXml.textFlowNS::img;
                    for each (var img:XML in imageList) {
                        var embeddedImage:Object = new Object();
                        embeddedImage.source = String(img.@source);
                        embeddedImage.width = parseInt(img.@width);
                        embeddedImage.height = parseInt(img.@height);
                        embeddedImages.addItem(embeddedImage);
                private function loadImage(imageSource:String):void {
                    var loader:Loader = new Loader();
                    var urlRequest:URLRequest = new URLRequest(imageSource);
                    loader.load(urlRequest);
                    loader.contentLoaderInfo.addEventListener(Event.COMPLETE, imageLoaded);
                private function imageLoaded(e:Event):void {
                    embeddedImages.getItemAt(numberOfImagesLoaded).bitmap = (Bitmap)(e.target.content);
                    embeddedImages.getItemAt(numberOfImagesLoaded).width = ((Bitmap)(e.target.content)).width;
                    embeddedImages.getItemAt(numberOfImagesLoaded).height = ((Bitmap)(e.target.content)).height;
                    ++numberOfImagesLoaded;
                    if (numberOfImagesLoaded < embeddedImages.length) {
                        loadImage(embeddedImages.getItemAt(numberOfImagesLoaded).source);
                    } else {
                        // all the images have been loaded... convert to textflow
                        buildContent();
                        printData();
                private function buildContent():void {
                    var contentIndex:int = 0;
                    for each (var contentElement:Object in contentData) {
                        if (hasImage(contentElement.contentText)) {
                            buildTextFlow(contentElement, contentIndex);
                            ++contentIndex;
                private function buildTextFlow(content:Object, contentIndex:int):void {
                    var textXml:XML = new XML(content.contentText);
                    var p:ParagraphElement = new ParagraphElement();
                    for each(var child:XML in textXml.children()) {
                        switch (child.localName()) {
                            case "span":
                                var span:SpanElement;
                                span = new SpanElement();
                                span.text = child;
                                span.fontSize = 10;
                                p.addChild(span);
                                break;
                            case "img":
                                var image:InlineGraphicElement;
                                image = new InlineGraphicElement();
                                image.source = embeddedImages.getItemAt(contentIndex).bitmap;
                                image.width = embeddedImages.getItemAt(contentIndex).width;
                                image.height = embeddedImages.getItemAt(contentIndex).height;
                                p.addChild(image);
                                break;
                    content.textFlow = new TextFlow();
                    content.textFlow.addChild(p);
                private function hasImage(contentText:String):Boolean {
                    var textXml:XML = new XML(contentText);
                    var imageList:XMLList = textXml.textFlowNS::img;
                    if (imageList.length() > 0) {
                        return true;
                    } else {
                        return false;
                private function printData():void {
                    printJob = new FlexPrintJob();
                    lastPage = false;
                    if (printJob.start()) {
                        thePrintView = new FormPrintView();
                        addElement(thePrintView);
                        thePrintView.width=printJob.pageWidth;
                        thePrintView.height=printJob.pageHeight;
                        thePrintView.printDataGrid.dataProvider = contentData;
                        thePrintView.showPage("single");
                        if(!thePrintView.printDataGrid.validNextPage) {
                            printJob.addObject(thePrintView);
                        } else {
                            thePrintView.showPage("first");
                            printJob.addObject(thePrintView);
                            while (true) {
                                thePrintView.printDataGrid.nextPage();
                                thePrintView.showPage("last"); 
                                if(!thePrintView.printDataGrid.validNextPage) {
                                    printJob.addObject(thePrintView);
                                    break;
                                } else {
                                    thePrintView.showPage("middle");
                                    printJob.addObject(thePrintView);
                        removeElement(thePrintView);
                    printJob.send();
            ]]>
        </fx:Script>
    </s:Application>
    FormPrintView.mxml
    ===============
    <?xml version="1.0"?>
    <mx:VBox
        xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/mx"
        xmlns:MyComp="myComponents.*"
        backgroundColor="#FFFFFF"
        paddingTop="50" paddingBottom="50" paddingLeft="50"
        >
        <fx:Script>
            <![CDATA[
                import mx.core.*
                    public function showPage(pageType:String):void {
                        validateNow();
            ]]>
        </fx:Script>
        <mx:PrintDataGrid
            id="printDataGrid"
            width="60%"
            height="100%"
            showHeaders="false"
            borderVisible="false"
            horizontalGridLines="false"
            variableRowHeight="true"
            >
            <mx:columns>
                <mx:DataGridColumn
                    itemRenderer="MyPrintRenderer"
                    />
            </mx:columns>
        </mx:PrintDataGrid>
    </mx:VBox>
    MyPrintRenderer.mxml
    =================
    <?xml version="1.0" encoding="utf-8"?>
    <s:MXDataGridItemRenderer
        xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark"
        xmlns:mx="library://ns.adobe.com/flex/mx"
        xmlns:bslns="com.knownomy.bsl.view.component.*"
        >
        <s:layout>
            <s:VerticalLayout
                paddingLeft="5"
                paddingRight="5"
                paddingTop="3"
                paddingBottom="3"
                gap="5"
                horizontalAlign="left"
                clipAndEnableScrolling="true"
                />
        </s:layout>
        <fx:Declarations>
        </fx:Declarations>
        <s:HGroup
            width="100%"
            gap="5"
            verticalAlign="middle"
            >
            <s:Label
                text="{data.srNo}"
                color="0x000000"
                fontFamily="Verdana"
                fontSize="10"
                />
            <s:RichText
                id="title"
                width="700"
                textFlow="{myTextFlow}"
                color="0x000000"
                fontFamily="Verdana"
                fontSize="10"
                />
        </s:HGroup>
        <fx:Metadata>
        </fx:Metadata>
        <s:states>
            <s:State name="normal" />
            <s:State name="hovered" />
            <s:State name="selected" />
        </s:states>
        <fx:Script>
            <![CDATA[
                import flashx.textLayout.elements.TextFlow;
                [Bindable]
                private var myTextFlow:TextFlow;
                override public function set data(value:Object) : void {
                    if (value != null) {
                        super.data = value;
                        myTextFlow = data.textFlow;
            ]]>
        </fx:Script>
    </s:MXDataGridItemRenderer>

  • BAPI_GOODSMVT_CREATE u2013 Collective slip not printed when called from Biztalk

    Hi Experts,
    Iu2019m trying to call BAPI_GOODSMVT_CREATE from within a Biztalk Orchestration.
    Everything works fine except for one thing: The printing of the collective slip.
    I made a quick test and the collective slip is printed when I call BAPI_GOODSMVT_CREATE from transaction SE37 (Test Sequences).
    I have used exactly the same parameters for the two cases.
    I can see that when I call the BAPI from SE37, an output is generated for the material document (MB03 / details / messages). 
    This is not the case when the call comes from Biztalk.
    I followed the documentation and the notes 520813 (Question 12), 426554.
    This means that:
      - The user executing the BAPI has the parameter NDR set to u2018Xu2019 in his profile.
      - VER_GR_GI_SLIP is set to u20183u2019 to ask for the collective slip print out.
      - VER_GR_GI_SLIPX is set to u2018Xu2019 to enable the print out.
    What should I do to be able to print a collective slip when calling the BAPI from Biztalk ?
    Thank you in advance for your help,
    Francisu2026

    hi,
    check out this thread.
    Re: User Exit for MSC2n( Batch) while doing a Good receipt for an order
    Ashutosh

  • How make "Scanner" not printing the output in a new line?

    Hi!
    I'm Jordi from Barcelona and I'm new on Java and on this Forum. I have a question to you. I'm developing a testing application that uses the "Scanner".
    Before using it, the app asks a question to the user:
    String strInput;
    Scanner sc = new Scanner(System.in);
    System.out.print("* Please, write your name: ");
    strInput = sc.next();Running this, the app asks me for the options and after pressing "Enter" prints the input string in a new line like this:
    * Please, write your name:
    Jordi
    And I would to get the next:
    * Please, write your name: Jordi
    Does anybody know how to make the "Scanner" print the output in the same line as the question?
    Thanks for your help!
    Jordi

    Running the code,
    import java.util.Scanner;
    public class Test {
        public static void main(String[] args) {
            Scanner sc = new Scanner(System.in);
            System.out.print("* Please, write your name: ");
            System.out.println("* Hi, "+sc.next());
    }results in the following output:
    * Please, write your name: Bart
    * Hi, BartWhere the first "Bart" is the input I gave.
    If this is not the case, then it has something to do with your IDE or perhaps you didn't recompile and it previously was
    System.out.println("* Please, write your name: "); // println instead of printbut it's all guesses.
    Good luck.

  • Officejet 7310xi does not print two-sided automatically after installing Windows 8.1

    When I first purchased my Officejet 7310xi and installed it on my Windows XP desktop PC it worked fine printing two-sided documents automatically. I recently purchased a new desktop PC with Windows 8 and upgraded it to Windows 8.1 and downloaded and installed the Officejet software drivers from the HP download site. But now the printer will not print two-sided documents AUTOMATICALLY -- when this option is selected, I get a pop-up screen telling me to remove the documents from the out tray, turn them around, and reinsert them in the feed bin, i.e., it acts as if I requested two-sided MANUAL printing.
    This question was solved.
    View Solution.

    Hi,
    Make sure the Automatic Duplexing option is enabled:
    Enter Control Panel > Devices and Printers.
    Right click the printer icon, then click Printer Properties.
    Click the Device Settings tab.
    Set the Automatic Two-Sided Duplex Accessory as installed and click OK to save the change.
    Now Automatic Duplexing should become available.
    Regards,
    Shlomi
    Say thanks by clicking the Kudos thumb up in the post.
    If my post resolve your problem please mark it as an Accepted Solution

Maybe you are looking for