Attaching/Linking XSL Question

Hi,
How can I attach/link an XSL file in an XML document that I'm currently creating/forming (using TransformerHandler)?
Here's the code:
try
       mTransformerHandler = mSAXTransformerFactory.
               newTransformerHandler(new StreamSource(new File(
               "D:\\tempTransform.xsl")));                     
       mTransformerHandler.setResult(new StreamResult(
               new File("c:\\tmp.xml")));
       Transformer trans = mTransformerHandler.getTransformer();
       trans.setOutputProperty(OutputKeys.ENCODING, "SHIFT_JIS");
       mTransformerHandler.startDocument();               
       mTransformerHandler.startElement("tag1","tag1", "tag1", new
               AttributesImpl());
       String str = "sample char";
       mTransformerHandler.characters(str.toCharArray(),       
               0, str.toCharArray().length);
       mTransformerHandler.endElement
               ("tag1","tag1", "tag1");                              
       mTransformerHandler.endDocument();
catch(Exception e)
       System.out.println("e >> " + e);
. . . .The XSL file transforms the xml into an html code.
What I need is just to attach/link the XSL to the created XML and not to transform to the output of the XSL.
Any suggestions?
Thanks a lot.

If I understand you correctly, you want it to output your XML as it is, but with a <?xml-stylesheet type="text/xsl" href="blah.xsl"?>?
If that's what you want, you don't need an actual transformation at all. You only have to insert a processing instruction into your document and use a handler that simply writes your XML to the output.
       // get a transformer that directly copies the XML to the output; no transformation needed
       mTransformerHandler = mSAXTransformerFactory.
               newTransformerHandler();                     
       mTransformerHandler.setResult(new StreamResult(
               new File("c:\\tmp.xml")));
       Transformer trans = mTransformerHandler.getTransformer();
       trans.setOutputProperty(OutputKeys.ENCODING, "SHIFT_JIS");
       mTransformerHandler.startDocument();
       // insert a processing instruction into the document
       mTransformerHandler.processingInstruction("xml-stylesheet", "type=\"text/xsl\" href=\"blah.xsl\"");
       mTransformerHandler.startElement("tag1","tag1", "tag1", new
               AttributesImpl());
       String str = "sample char";
       mTransformerHandler.characters(str.toCharArray(),       
               0, str.toCharArray().length);
       mTransformerHandler.endElement
               ("tag1","tag1", "tag1");                              
       mTransformerHandler.endDocument();

Similar Messages

  • How display attachment links in a list view in SharePoint 2013?

    Hi all,
    I'm looking for a way to display attachment links in a list in SharePoint 2013. There are few resources online to achieve this in SP2010 and SP07. Your help is much appreciated.
    Thank you.

    Hi Ram Sampath:
    You can use Event Receiver and create another list(ListA) to record your attachment link.
    Maybe your process is:
    Users add list items and attachments
    List event will be fired
    Use Event Receiver to get attachment url and then Write into ListA
    You also can refer to the following web site:
    https://social.technet.microsoft.com/Forums/sharepoint/en-US/b693eb84-b846-4f0f-93c1-276cf931c746/how-to-get-attachment-in-itemadded-event-receiver
    http://stackoverflow.com/questions/19077770/how-to-retrieve-list-item-attachments-with-sharepoint-2013-event-receiver-in-cor

  • Attaching links to buttons exported into dreamweaver CS3 ?

    Hi everyone,
    I want to create five seperate buttons in Fireworks CS3 and then export them over to Dreamweaver CS3.
    Does the links for the buttons have to be attached in Fireworks first, or can I create the buttons export them into my Dreamweaver site and then attach the links?
    The reason I'm asking is because the links in question are external links for five other sites and social network sites, and I do not have the URL's yet. However I would like to get started.
    Thanks in advance.

    I want to create five seperate buttons in Fireworks CS3 and then export them over to Dreamweaver CS3.
    Does the links for the buttons have to be attached in Fireworks first, or can I create the buttons export them into my Dreamweaver site and then attach the links?
    You are best to create the buttons in Fireworks, export them to an images folder in Dreamweaver, then attach the links that way.
    Before you begin work, ensure that you define a site and have all your working files inside of one folder to which the site definition points to,
    (Just mentioning this very important step in case you are new to using Dreamweaver  :-)
    Define a site:
    http://kb2.adobe.com/cps/140/tn_14028.html
    Do not ever export any html written by a graphics program  :-)

  • Personalizatio:  Attachment Link

    Hi All,
    I have a requirement to create an attachment link on the Work Order completion screen. Basically to display attachments that are against the Work Order. I am trying to do this using the Admin Level personsalizations functionality. I can get the link to display and it works fine, except the personalization functionality does not allow me to create more than 1 primary key for the attachment link. Because in the FND_ATTACHED_DOCUMENTS table Work Order attachments are stored with multiple keys (composite keys), I cannot see any existing attachments. Any new attachments I create using the personalization are not visible anywhere else in the system, and are stored only with the PK I setup the attachment link with (as expected).
    My question. Can we create an attachment link using personalizations with multiple primary keys?
    I have seen this done for the standard screens (which have been developed in JDev using OAF) so it is possible using the framework just not in personalizations.

    Hello,
    check this link:
    Activate GOS business application for object PREL
    I hope it helps you.
    Regards,
    Pedro

  • The attachment link for the new hotmail is not working - 1 March 2013

    Hi there
    I have just recently upgraded to the new hotmail platform on 1 March 2013. Found out that the attachment file link is not active when you compose a new message. When you click on it, nothing happens. My current Safari version is 6.02. Before that, everything was well. I have posted this question on the microsoft community and got a reply with a link to post my concerns here instead. The new attachment link however is working on IE & Firefox browsers (I checked on my friends' browsers). Could someone please advice & help. Thank you
    Cyn05

    Hope this photo helps.

  • Attachment Link Not appearing

    Hello Experts,
    Attachment link button is not appearing on the toolbar, Can anyone know how to Activate that button.
    Thanks.

    Hello,
    check this link:
    Activate GOS business application for object PREL
    I hope it helps you.
    Regards,
    Pedro

  • Add Attachment link doesn't open attachment window

    I'm trying to debug a custom page, written by someone else. It's in the recruitment module, and delivered subpages HRS_CE_A_RES_SBP and are included to allow attach/view/delete of attachments.
    When the Add Attachment link is clicked, it should open a window that lets the user enter a filename or browse, but on this custom page, nothing happens.
    Because the delivered code is unmodified, I suspect that there is some setup that hasn't been done. The component does contain table HRS_APP_ATTACH, which includes subrecord FILE_ATTACH_SBR. The component also contains record FILE_ATTACH_WRK.
    Can someone suggest my next step? Thanks.
    Mike
    HCM 9.0, PTools 8.49.20

    Generally Add attachment issues are enountered while setting up new regions for the reason URL not updated while setting up new region.
    In this table PSFILE_ATTDET a row is inserted temporarily with Oprid and deleted once the specified file is trasferred mentioned url successfully.
    Example: AddAttachment(&URL_ID, &ATTACHSYSFILENAME, &FILEEXTENSION, &ATTACHUSERFILE, &FILESIZE)
    works when &ATTACHUSERFILE =file-name and &URL_ID=gerurl(url.urlname) are given properly.Please check these parameters.

  • Attachment link is not visible- external content server

    Hi All,
    I have integrated an external content server to SAP
    i have done following activities:
    1) I have maintained content repository using Tcode OAC0
    2) I have Maintained Global Doc Type (ZFININV  Finance Invoice scan doc document class: TIF) using Tcode OAC2
    3) i have maintained Link for Doc type ZFININV and assigned Object type: BKPF    using tcode OAC3
    4) I have  all My documents  scaned and residing there on my content server . So i have manually created entry for these documents in Table TOA01 .
    5) I have maintained protocol using tcode OAA3
          Function : Display Stored Document
         Doc Class: FAX
          communication type : HTTP
    In application Maintenance i have used internet explorer as an application.
    7) In tcode OAG4 : i have maintained settings for storage and display.
    8) Now i can search document using Tcode OAAD. i can display document in my content server viewer
    Now my customer wants that while doing business transaction , customer should be able to attach link of supporting document   which is already residing there on my content server.
    Say for example: I display a Finance document using tcode FB03. While doing maintenance of this document ,from the same screen , i want to attach supporting document (or link of the document) which is already archived there in my content server
    but when i click on attachment list (using  GOS) , i can not see any link which i can attach to this transaction
    please suggest me .. whether i forgot any step Or is there any other way to do this requirement?
    thanks
    sandeep sharma

    Dear all,
    as naveen replied in this thread:
    Alteratively, in FB03, try using Environment -> Additional Assignments to see if it meets your requirements. You will have to explore a bit and do some trial and error tests for the solution as this is a particular requirement which you have got.
    This is standard functionality provided by sap
    Storing Incoming Document->Manual storing-> Assigning a Document that is Already Stored:
    http://help.sap.com/erp2005_ehp_04/helpdata/EN/4f/99386b446d11d189700000e8322d00/frameset.htm
    For this additional assignment, the time at which the business object was created does not matter. It is also possible to assign other archived documents to existing business objects. An archived document is assigned using the function module ARCHIV_APPEND_DIALOG_META.
    This additional assignment fulfils my requirement . but i cant see this option for other transaction (say for example ME51n or MM01 ) for which  i can do this additional object assignment.
    Is it possible to add this additional assignment  option in another business transactions context menu? or anyother work around to fulfill this requirement...
    thanks
    sandeep
    Edited by: sandeep sharma on Dec 8, 2010 6:28 AM

  • Delete Attachment link and the launchWebdynpro button in the UWL iview

    Hi,
    Can anyone help me in deleting or hiding the Attachment link and the launchWebdynpro button in the UWL iview. I dont want to do it in the iview properties which would affect all the tasks. Is there a way I can do it in the backend.\
    I appreciate the help.
    Thanks

    Hi Surjith,
    I have the same problem. How can I remove the link? After I called the mentioned function module, the attachment was removed (content) but in the UWL the file name is still there:
    From UWL:
    myFile.pdf by WF-BATCH (94 kb)
    myDeletedFile.pdf   <-- I removed this one with the function module
            CALL FUNCTION 'SAP_WAPI_ATTACHMENT_DELETE'
              EXPORTING
                workitem_id     = me->mv_wf_instance_id
                att_id          = ls_att_id
                delete_document = abap_true
              IMPORTING
                return_code     = lv_return.
    Could you please help me?
    Thanks,
    Thomas

  • ABAP OO sales order object - how to attach link to VA03

    I'm trying to build workflow using ABAP Objects instead of BOR. I created custom object for sales order according to blog "Getting started with ABAP OO for Workflow using the IF_WORKFLOW interface". It works correctly in my workflow but I would like to attach link to "browse sales order" (VA03) to workflow step. When using BOR I can attach link my binding BOR objest to AdhocObjest step container element. The same way does not work for ABAP OO object. The error message is "The object categories 'CL' (source) and 'BO' (target) are not compatible".
    Is there any way to add this link to attachments when sales order object is OO not BOR?

    At least make sure that you have a default method 'browse' in your class. I mean that make a method for "displaying" or "browsing" or whatever you want to happen when you click the object, and make it default. OR actually if I remember correctly there is a default method existing already, but put your code to there.
    Also try this:
    -Create a container element of type 'sales order' into your task
    -Bind the sales order object from workflow to the the task
    Regards,
    Karri

  • My Add an Attachment link does not open, how do I get it to open?

    I open an email and try to add a document or picture using the Add Attachment link but it will not open. Nothing happens when I click on it. I uninstalled Firefox and re=installed it and it still does not work. It does work on Internet Explorer.

    Check your flash plugin is updated!
    *https://www.mozilla.org/en-US/plugincheck/

  • Attachment Link To Specify Folder

    Hi,
    Need some help on the sharepoint attachment link to direct go to specify folder. Is it any possibility that during user clicking on the attach file button, the choose file to upload folder is point to our specify define folder ?
    Very appreciate if someone can give some idea on how to do it.
    Thanks !
    Leong

    Hi,
    As far as I know, we cannot point the choose file path of attachment to specify define folder. The behavior is handled by browser's memory.
    Thanks,
    Eric
    Forum Support
    Please remember to mark the replies as answers if they help and unmark them if they provide no help. If you have feedback for TechNet Subscriber Support, contact
    [email protected]
    Eric Tao
    TechNet Community Support

  • Attach (link) source file to PDF

    Is there any way to attach (link) the source file (MS word or publisher) to a PDF file using Acrobat Pro Extend 9?

    Yes. Open the attachments panel and add it.

  • Enable attachement link in Purchase requisition approval WF

    Dears ,
    How to enable attachment link in purchase requisition approval wf ,??

    hi
    In the workflow, you need setup the agent assingment(i.e organizationlal roles)

  • GOS - Attachment - Link is not deleting from SRGBTBREL

    I have created custom transaction and this have option to attach desktop files (ie Word, Xls, PPT, PDF) etc into this transaction. For this i am using class CL_GOS_MANAGER.
    After the attachment sometimes users will delete the attachments from attachment list.
    My problem is some attachment links are not deleted completely  from SRGBTBREL (Link Table) . Because of this next time users displaying the attachment list still the deleted entries are showing in the list.
    If users double clock  it is giving a error message "Document does not exist" ( message class SO and message Number 006) .
    Any body come across this kind of scenario?
    Given below is the code for deleting the attachments
    * Object creation of GOS View
        create object gos_view
          exporting
            ip_mode = 'D'.                     " Display Mode
    * Start GOS Service for attachement view
        i_viewobj-objtype = 'YATT_ATTA'.
        i_viewobj-objkey = yatthdr-docno.
        call method gos_view->start_service_direct
          exporting
            ip_service = 'VIEW_ATTA'
            is_object  = i_viewobj.
    a®s.
    Edited by: a®s on Feb 18, 2008 3:20 PM

    Mylene,
    Thanks for your info. I already saw this note. Please share if you any info how we can delete the SRGBTBREL links completely using class  CL_GOS_MANAGER?
    I already run the program RSGOSRE01 (suggested in the note 569123) But nothing is shown. But the document showing in the SRGBTBREL links it have attachment
    For example , the following are the links from SRGBTBREL
    BRELGUID                         RELTYPE      INSTID_B
    475E7A046A581C0EE1000000A3F331A3 ATTA         FOL27000000000004EXT32000000033688
    475E828FD2561C0DE1000000A3F331A3 ATTA         FOL27000000000004EXT32000000033775
    476515A0A02A0E78E1000000A3F331A3 ATTA         FOL27000000000004EXT32000000034502
    47651683A02A0E78E1000000A3F331A3 ATTA         FOL27000000000004EXT32000000034503
    Here the last link still showing in the table , but i find there is not attachment
    47651683A02A0E78E1000000A3F331A3 ATTA         FOL27000000000004EXT32000000034503
    Any more Info?
    Edited by: a®s on Feb 19, 2008 8:58 AM

Maybe you are looking for