Howto include external document from Xalan extension?

Hi,
I'm trying to include an external XML document via the document() function,
but I can't seem to get it to work. The catch is that the external document is
created by a Xalan extension function.
My code is as below. The code in the extension class is successfully executed.
However, when I run the transformation, I keep getting a
java.lang.ArrayIndexOutOfBoundsException. Does anyone know what's going
wrong?
Regards, Ronald Wildenberg.
Style sheet:
<?xml version="1.0" encoding="utf-8" ?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
   xmlns:cpb="builders.CpbBuilderFunctions" extension-element-prefixes="cpb">
<xsl:template match="/">
   <xsl:copy-of select="cpb:test()"/>
</xsl:template>
</xsl:stylesheet>Java code:
public class CpbBuilderFunctions {
   public static Document test() {
      try {
         DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
         DocumentBuilder builder = documentBuilderFactory.newDocumentBuilder();
         Document document = builder.parse(new InputSource(new StringReader("")));
         System.out.println("Successfully returning!");
         return document;
      catch (Throwable e) {
         e.printStackTrace();
      return null;
}

Ok, I tried again to implement this after the weekend and now it all works. Very nice of course, but I don't know what went wrong before. But this item can be considered closed :)

Similar Messages

  • Biiling with reference to external documents

    Is it possible to create invoice with reference to the external documents (from SAP Real Estate) automatically in SD?  Please advise.
    Thanks,
    ak

    If you want to preserve the xml exactly as is, then store it as varbinary(max).  This will of course mean you can't use the features of the xml datatype.
    USE tempdb
    GO
    DROP TABLE [dbo].[XmlTest]
    GO
    CREATE TABLE [dbo].[XmlTest] ( xml XML, vbin VARBINARY(MAX) )
    GO
    DECLARE @xml NVARCHAR(MAX);
    SET @xml = '<!DOCTYPE R [<!ELEMENT R (#PCDATA)> <!ENTITY ndash SYSTEM "http://localhost/ExEnt.ent">]><R>&ndash;</R>';
    INSERT INTO [dbo].[XmlTest] VALUES(CONVERT(XML, @xml, 3), CONVERT(VARBINARY(MAX),@xml));
    GO
    SELECT *, CAST( VBIN AS nvarchar(MAX))
    FROM [dbo].[XmlTest]
    Is that an option for you?

  • HT4859 How do I back up my documents from my Macbook on iCloud? or can I only use time machine or external HD?

    How do I back up my documents from my Macbook on iCloud? or can I only use time machine or external HD?
    I think I have missed something in trying to read all of the pages on apple site about icloud.

    Welcome to the Apple Community.
    You can't back up a computer to iCloud.
    You can use any back up software, you should always back up to a different drive.

  • By backing up the iTunes Library via saving the iTunes folder on an external drive, is it also backing up all iPad and iPhone backups as well as App Data and Documents from your devices?

    If I backup my iTunes Library by saving the iTunes folder on an external hard drive using the instructions contained in the link below, will it also back up all my iPad and iPhone backups as well as App Data and Documents from my devices? In other words, will it also create backups for the backups? Thank you.
    Back up your iTunes library by copying it to an external drive
    Furthermore, when it is time to restore the iTunes folder I copied to my external drive to a new iTunes program on my new computer, how will it merge the information once I plug in my iPad or iPhone to that new laptop to sync? If I did the iTunes library backup a couple months ago and I've added documents/music/pictures on my devices since then, what will happen when I try to sync it with the new laptop now working off of the iTunes library backup from a couple months ago since the information is no longer the same? Which information will dominate and thus be kept? Will it delete the new information/data/pictures/documents/music off of the devices since it is not on the iTunes program when it syncs?
    Sorry for so many questions, but they are all related to backing up and restoring iTunes. I am not very tech savvy if you cannot tell

    It would be a good idea to look into a bigger hard drive. They are not that expensive any more and can save a lot of headach. This is even more important if you are buying music from the iTunes music store. If you lost those files they are gone.
    The point of having it on your PC and iPod is to have a backup. If the iPod fails, or you need to go back to the DVDs and find they are scratched, or just can not be read you have lost days of work converting and organizing all of those songs.
    Or the iPod could hard drive could fail and then you will have to try to bring all of those files back from DVDs. You end up with a mess since some songs will probably be on multiple DVDs, have different names ect. Trying to reorganize it all can be a pain.

  • HT201250 Can I include external drives to be backed up using Time Machine.  Not only do I want to back up my IMac, but I have several extenal drives for one iPhoto, one iTunes and one for other files & documents.

    Can I include external drives to be backed up using Time Machine?  Not only do I want to back up my IMac, but I have several extenal drives for one iPhoto, one iTunes and one for other files & documents.  How do I know if they are included in the backup process?

    Yes, if they are not exclude then TM backs them up.
    Allan

  • Constructing a new Document from External Nodes

    Constructing a new Document from External Nodes
    I have a situation where:
    1.     I have an existing XML Document
    2.     I need to parse for specific Nodes under varying conditions
    3.     Once the Node is identified -- I would like to append this node as a new Node in a new Document
    Is this possible? The methods in the API do not lend themselves to attaching a Node that was not explicitly created by the target Document.

    Hummm�
    That works, sort of; it does allow the node to be imported, but at the Document level only. I will need to apply this at various Node (Element) points, which the API does not permit.
    Thanks for the info.

  • Printing scanned documents from external system

    Hi All
    Is there any function module available in SAP which can print the scanned document available in external system.
    My requirement is :
    They will maintain a reference number of the scanned document in Material master.
    so when ever they print the' route sheet' we have to pick the scanned document from the external system based on the reference number and print along with the
    ' route sheet'.
    Thanks & Regards,
    Kishore

    Hi John,
    Could you please let me know the function modules .
    Right know am using cv120_start_application ,But with this function module I am unable to print the images (Not able to print JPG,BMP and PDF documents)
    My requirement is SNP format document will be attached in material master.
    Thanks in advance.
    Regards,
    Kishore

  • Park The Document from external system

    hi experts,
    is there any way to park the documents from the external system.
    i.e Idoc,Bapi .....
    thanks&regads,
    srinivas.

    HI,
    I would like to suggest the following BAPIs:
    1) BAPI_INCOMINGINVOICE_PARK (parking invoice document)
    2) BAPI_INCOMINGINVOICE_CHANGE (changing a parked document),
    3) BAPI_INCOMINGINVOICE_POST (posting a parked document) and
    4) BAPI_PARKEDINVOICE_DELETE (deleting a parked document).
    Please refer to documentation of these function modules.
    Regards
    ravinagh Boni

  • Documents from external system

    Hi experts.
    I would like to aks You how can I solve following problem:
    1. I have an aplication in ABAP
    2. There is an external aplication for optical archive of documents
    3. We are ucing JaCo to communicate with external aplication.
    And, main problem is, that I need to view scanned document from external aplication in our SAP aplication.
    I have two ideas:
    1. through HTML viewer - I will get an URL addres of HTML code of the scanned document - but, there is an problem with rights. To view this URL i need this url has to be a public (user's browser must "see" it). but, this is not possible to public this url, because there are scanned agreements. And, when this url is private only for SAP server and external application, the HTML viewer cannot find it ..... I have thinking about using username and password in HTML code and url addres, but, that is not what I prefer ...
    2. through PDF - the external application create an PDF document on their directory. But, how can I view this PDF in SAP (from external directory in other system).
    Many many thans for any answer.
    Have a nice day .....

    Hi,
    From your description, you want to get numerous files into SharePoint Document Libraries.
    After you log on to the SharePoint document library->click Actions->followed by
    Open with Windows Explorer. After Windows Explorer opens, you can upload and download files and folders using the standard copy-and-paste operation.
    Refer to the article:
    http://windowsitpro.com/systems-management/easy-way-get-numerous-files-and-out-sharepoint-document-libraries
    Best Regards,
    Lisa Chen
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How to send delivery document from external system to ECC

    i have a business requirement to send a delivery and billing documents from external system ( MS access )  to ECC
    could any one light me how to do this ???
    Thank you in advance

    Hi Ahmed,
    Talk to your middleware team, They will upload the data through RFC.
    Basiclly RFC(Remote function call) works like it will call the function module and then upload the data.
    For more information, check the link given below.
    http://help.sap.com/saphelp_nw04/helpdata/en/6f/1bd5b6a85b11d6b28500508b5d5211/content.htm
    Hope this helps,
    Regards,
    MT

  • I have scanned a document, how do I save to a specific folder on an external drive from the Preview application?

    I have scanned a document, how do I save to a specific folder on an external drive from the Preview application?

    There is no 'Save as' in Lion.  If it's a new document then select File -> Save will bring up a standard 'Save' dialog box which will allow you to specify the location.  Otherwise select File -> Duplicate and then save the duplicate.

  • How can I hyperlink from FM to an external document and make the links work in PDF-XChange Viewer?

    A couple of months ago some of you kindly taught me how to insert links to an external document in FrameMaker. The syntax that made all the difference, was the following:
    message openfile "H:/folder name/to/your/file.ext"
    I converted my FrameMaker file to PDF format using Acrobat Distiller, and everything worked like a charm when the users opened the resulting PDF document in Acrobat Reader.
    Much to my frustration, someone has now decided that the organisation should use PDF-XChange Viewer instead of Acrobat Reader, and my links don't work anymore... Nothing happens when you click on them. (This only applies to links to external documents. Links to e.g. websites work nicely.)
    Has anybody got any idea what I could do to make the links work in PDF-Xchange Viewer as well? Or am I trying to do the impossible now?
    Best regards
    Jorunn

    Jorunn H wrote:
    A couple of months ago some of you kindly taught me how to insert links to an external document in FrameMaker. The syntax that made all the difference, was the following:
    message openfile "H:/folder name/to/your/file.ext"
    I converted my FrameMaker file to PDF format using Acrobat Distiller, and everything worked like a charm when the users opened the resulting PDF document in Acrobat Reader.
    Much to my frustration, someone has now decided that the organisation should use PDF-XChange Viewer instead of Acrobat Reader, and my links don't work anymore... Nothing happens when you click on them. (This only applies to links to external documents. Links to e.g. websites work nicely.)
    Has anybody got any idea what I could do to make the links work in PDF-Xchange Viewer as well? Or am I trying to do the impossible now?
    Best regards
    Jorunn
    Have you tried contacting the PDF-Xchange company's technical support? What results?
    Regards,
    Peter Gold
    KnowHow ProServices

  • Including comments entered from Document Library to Records Center Record Library

    We are currently sending documents from a SharePoint 2010 site to a Records Center.
    We are using the Collect Signatures workflow, and edited this default workflow in SharePoint Designer to then send the document to a Records Center when both signatures have been applied.
    Everything is working well, but we'd like to enter comments @ the originating document library...which we can do now...and have those comments get sent over to the Records Center as well when the document is signed by both people.
    Are we able to do this?  ...have comments entered in the Document Library show up in the Records Center Records Library?
    Thank you!

    Hi Joe,
    If your settings are configured as below,
    The site collection Record Declaration Settings are set to "Block Edit and Delete"
    The Record Library is set to "Automatically declare items as records when they are added to this list."
    The Drop Off Library Record Declaration Setting is set to site collection default: Do not allow the manual declaration of records;
    then the item(e.g. Test.xlsx) routed from "Drop Off Library" will be declared as a record in this Record Library, which is inherited from site collection setting "Block Edit and Delete" and auto declare on library option is enabled, then
    this "Test.xlsx" item will be read-only as record and it can not be edited and deleted by design. 
    From the following error message you provided, it seems you secondly upload the Test.xlsx file in "Drop Off Library", then this time the "Content Organizer" will route
    this second Test.xlsx file to the Record Library again, however it cannot update a read-only item with the same name for Test.xlsx previously existed in the Record Library.
    "Unexpected Routing Engine: File DropOffLibrary/Test.xlsx could not be routed to /sites/records/Records/101-01 in site http://records/sites/records : This item cannot be updated because it is locked as read-only."
    If above is the case, for resolving this issue, you can use the following two methods:
    1. Use the option "<label for="ctl00_PlaceHolderMain_versioningSection_appendUniqueCharsRadioButton">Append unique characters to the end of duplicate filenames</label>" for "Content Organizer" settings.
    2. Or use the option "<label for="ctl00_PlaceHolderMain_recordBehaviorSection_recordBlockDeleteRadioButton">Block Delete</label>" for site collection "Record Declaration" Settings.
    Thanks,
    Daniel Yang
    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]
    Daniel Yang
    TechNet Community Support

  • Migrate word documents from external system to SharePoint 2007 site

    Hi All,
    I have a requirement wherein I have to migrate around 2500 word documents from one of the system to SharePoint system.
    Please note that my client is using MOSS version of SharePoint.
    Also some excel files are embedded in to some of the word documents.
    Those word documents are stored in different system (other than SharePoint).  I have to migrate them into my MOSS system.
    Is it possible OOB. I suppose doing it manually will consume a lot of time and client wants it do be done in minimum time.
    Is there any tool readily available or do I have to develop one in visual studio 2005? If yes could some one please share the code as I do not know how to proceed on this.
    Your help is highly appreciated.
    Please respond. Let me know if you need more info.
    Thanks & regards,
    Manish

    Hi,
    From your description, you want to get numerous files into SharePoint Document Libraries.
    After you log on to the SharePoint document library->click Actions->followed by
    Open with Windows Explorer. After Windows Explorer opens, you can upload and download files and folders using the standard copy-and-paste operation.
    Refer to the article:
    http://windowsitpro.com/systems-management/easy-way-get-numerous-files-and-out-sharepoint-document-libraries
    Best Regards,
    Lisa Chen
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How do you retrieve Many documents from an external content repository

    We are using P8 to store our AP Imaging documents (invoices).  The conenction for this is set up through all the standard document management configuration using OAC0, OAC3, etc.
    I wrote an ALV program that allows the users to search SAP and it will give them the unique GuiID that is passed between SAP and P8.  This works great for retrieving document data, and then in the ALV layout I have a hot spot on the document number so it will launch SAP function module: ARCHIV_GET_CONNECTIONS and display the invoice using standard functionality.
    The client has recently recieved a request to pull over 2500 invoices and save them in a folder for review.  I tested BAPI_DOCUMENT_CHECKOUTVIEW2 and it either doesn't allow me to connect to the P8 system, or I'm filling out the document type and document nuber different from what SAP expects.
    Question:
    Has anyone recieved a similar request to extract multiple documents from a content repository and what did you use to accomplish this?
    Thanks,
    Anthony

    After the weekend has past, could it be true?  No one has had to do this yet?
    Thanks,
    Anthony

Maybe you are looking for