Generating !DOCTYPE tag for a Document

I am using the SDK JAXP implementation of DOM to parse a simple XML document containing a !DOCTYPE tag, make a minor modification and write it back to a file. All works fine except that the !DOCTYPE tag is not written to the StreamResult by the Transformer.
getDoctype() on the Document does return a Doctype object that was parsed, but it's not written when transforming the Document into a StreamResult.
How do I write the !DOCTYPE tag into the output?
Please help.
Nikhil

Set DOCTYPE_SYSTEM output property.
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer = tFactory.newTransformer();
transformer.setOutputProperty(javax.xml.transform.OutputKeys.DOCTYPE_SYSTEM, "exampleDtd.dtd");

Similar Messages

  • Function Module to Generate Outbound IDOC for Sales Documents

    Hello Experts,
    Can someone please help me, I need to know which function module to use in order to generate the outbound IDOC for sales documents.  Some of the fm's I have come across are the following:
    IDOC_OUTPUT_ORDERS, but actually for Purchase Orders
    IDOC_OUTPUT_ORDRSP, but did not generate any IDocs for my sample Sales Order.
    Points will be given for any help provided.
    Thanks in advance.

    Hi Nagaraj,
    I tried using the IDOC_OUTPUT_ORDERS but I keep getting an error that the Purchase Order <xxx> does not exist, even though the document I tried is a sales order.  For everyone's reference here is the code:
    form process_data.
      DATA v_idoc       TYPE edidc-docnum.
      DATA i_edidd      TYPE TABLE OF edidd.
      DATA wa_idoc_ctrl TYPE edidc.
      LOOP AT i_nast INTO wa_nast.
        CLEAR i_msgs[].
        CALL FUNCTION 'WFMC_PROTOCOL_GET'
          EXPORTING
            cps_nast        = wa_nast
          tables
            messages        = i_msgs
         EXCEPTIONS
           NOT_FOUND       = 1
           OTHERS          = 2.
        LOOP AT i_msgs INTO wa_msgs WHERE arbgb EQ 'E0'.
    *--- Check first if there is an IDOC
          IF wa_msgs-msgv1 IS INITIAL.
            CONTINUE.
          ENDIF.
          v_idoc = wa_msgs-msgv1.
          CLEAR i_edidd[].
          CLEAR wa_idoc_ctrl.
          CALL FUNCTION 'IDOC_READ_COMPLETELY'
            EXPORTING
              document_number                = v_idoc
            IMPORTING
              IDOC_CONTROL                   = wa_idoc_ctrl
    *         NUMBER_OF_DATA_RECORDS         =
    *         NUMBER_OF_STATUS_RECORDS       =
            TABLES
    *         INT_EDIDS                      =
              INT_EDIDD                      = i_edidd
            EXCEPTIONS
    *         DOCUMENT_NOT_EXIST             = 1
    *         DOCUMENT_NUMBER_INVALID        = 2
              OTHERS                         = 3.
          CALL FUNCTION 'IDOC_OUTPUT_ORDERS'
            EXPORTING
              object                              = wa_nast
              control_record_in                   = wa_idoc_ctrl
    *       IMPORTING
    *         OBJECT_TYPE                         =
    *         CONTROL_RECORD_OUT                  =
            tables
              int_edidd                           = i_edidd
    *       EXCEPTIONS
    *         ERROR_MESSAGE_RECEIVED              = 1
    *         DATA_NOT_RELEVANT_FOR_SENDING       = 2
    *         OTHERS                              = 3
          IF sy-subrc <> 0.
    * MESSAGE ID SY-MSGID TYPE SY-MSGTY NUMBER SY-MSGNO
    *         WITH SY-MSGV1 SY-MSGV2 SY-MSGV3 SY-MSGV4.
          ENDIF.
          COMMIT WORK.
        ENDLOOP.
      ENDLOOP.

  • Want to generate single spool for diffrent documents

    Hi All,
    I have developed one BDC which will call report 'FBZ5' (for print form for payment documents). The print report is copied from RFFOUS_C.
    FBZ5 is used to print one document at a time so I have created this BDC for multiple documents.
    The probelm wat i m facing is BDC is generating sinlge spool for each and every document. I want to generate only single spool for multiple documents. Wat should I do.
    Thanks,
    Swapnil
    Message was edited by:
            Swapnil Swami

    I had a similar problem and the resolution was to update program ZRVADOPFO as follows:
    before the * open form line insert the following:
        if sy-batch = 'x'
        and nast-vsztp < > 3 or 4
            clear lvs_itcpo-tdnewid
       endif
    This solved it for me.  Good luck.

  • GENERATE A LINK FOR PURCHASE DOCUMENT

    Hi,
    our scope is to generate a link for a purchase document in a 45.B release.
    Manually we can, inside a PO, go to menu system>links and add a url link for the opened document (link type URL).
    Is it posible to generate this link form abap starting from the PO number with a bapi op function module ?
    Otherwise is it possible to customize the links in order to obtain some default values, always present in the links list  for all PO ?
    Best Regards
    Riccardo Galli

    A link is a hyper-link. Therefore, it should be applied to all readers or browsers. It should be applied to all protocols, PDF, HTML, and etc. If a link can contain page or bookmark information, readers or browsers should be able to go to that page or bookmark directly. They need not do it manually. This feature will be very good for reviewers when they have a lot of cross references in documents.

  • Pbm with document name while generating URL for created document

    Hi Gurus,<br>
    <br>
    When we upload a document and generate the URL for that document, and then while we paste the same in the explorer window to access it, I was able to see the dialog asking me whether to save or open the document with the <B>actual document name</B>.<br>
    <br>
    But, when I create a document using the template which we uploaded in SOLAR_PROJECT_ADMIN, and then generate the URL for that document, and then when I paste it in the explorer window to access it, the dialog now asks me to save or open the document, but it is not with the name of the <b>actual document</b>, but with the name of the <b>template</b>. <br>e.g <b>Business_Blueprint_template</b>.<br>
    <br>
    Can anyone say why such a problem? and how to solve it.<br>
    <br>
    Useful answers will certainly be greatly appreciated.<br>
    <br>
    best regds,<br>
    Alagammai.<br>

    Hi Gerry,
    try content matrix it gives you free 25 GB and it keeps metadata
    http://www.metalogix.com/Products/Content-Matrix/Features.aspx
    Kind Regards, John Naguib Technical Consultant/Architect MCITP, MCPD, MCTS, MCT, TOGAF 9 Foundation

  • Generation of XML Tags for columns in Lexical parameter in select query

    Hi,
    I have lexical parameter in my select statement of my data model in the report.
    How do i generate XML tags for these columns inside a Lexical Parameter?
    Simple Example: I have data model query as follows:
    SELECT msi.inventory_item_id
    &LP_SELECT
    FROM mtl_system_items_b
    Here my lexical Parameter LP_SELECT is generated in before report trigger as follows in my report:
    :LP_SELECT := 'msi.segment1,msi.description';
    So, the question is how to generate XML Tags for columns in Lexical Parameter(as in the example above, i need XML tags for these columns - segment1 and description)
    Thanks,
    Ratan

    try this
    Select &order data_show
    from oe_order_headers_all
    where order_number ='7889'
    and setting  :order:='order_number';  in after parameter form trigger.
    Hope this helps
    Hamid

  • Linking options for Word documents

    This question was posted in response to the following article: http://help.adobe.com/en_US/robohelp/robohtml/WS5DFA0634-079B-4265-89D7-2A59540BAB2D.html

    I'm a new user to RoboHelp10 and, based on research I've done online, I think the best use of the product for me is to link to previously-created word documents in order to create my online help project, since they are set up in a way that will translate into the topics.   I am trying to create a project and to link documents instead of importing them, since I think from a maintenance perspective, this will be better long-term.  I am also considering my company's my company's version control processes already in place.  I chose to "Create a Copy and Link" so all the linked files are contained within the project itself, and I generated the topic for the document I'm working with right now.  I then updated the Word document (via RoboHelp) and based on the help topic in "help.adobe.com/en_US/robohelp/robohtml/WS5DFA0634-079B-4265-89D7-2A59540BAB2D.html#commu nity" I thought that updating the Word document would automatically update the topic(s) linked to it, as long as I updated the copy of the document that RoboHelp created (and I actually did this by right-clicking on the doucment and chosing edit).  I saved and closed the Word document, and when I didn't see the topic updated, I right-clicked on the linked document but could not select Update (it's grayed out).  If I choose Force Update I am then able to see my updates from the document to the topic.  I don't understand why RoboHelp isn't recognizing the changes I make to the documents that are linked via "Create a Copy and Link".  Can someone tell me what step I'm missing?  And, even better, if you can understand my intntions above, and can recommend a better way to set up my project, that would be even better.  Thank you, and have a great day!!!

  • Problem with DOCTYPE tag in the index.html for flex file

    When I have the following !DOCTYPE tag in the index.html file I use to load the flex swf file(s) both FireFox and Orical browsers both become horizontally shortened.  When the tag removed everything works fine.  Given that the !DOCTYPE tag is necessary for good html I'd really like to know what's going on.
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

    Good info on that site about HTML, unfortunatly it had nothing new for me.  I did double check and everything and I was doing things the way they recomend.
    I'm really bothered that this is happening.  The DOCTYPE tag should be used and it should not have this effect when added to the HTML generated by the Flex Builder.  Additionally the new Flash Builder does have the DOCTYPE tag in its generated HTML and this is very worrisome.

  • Problem while generating Update progam for a Change Document Object

    Hi,
    I'm trying to deal with Change Document concept in a R/3 4.6C environment and to establish new Change Document object for my (Z)-table. I haven't using any namespace and created object with name ZTEST. Following the online documentation I came to the point, where I have to generate include program. I made all the nessesary inputs (using Z prefix) but faced
    "Function module name is reserved for SAP"
    Creating everything similarily using some of our registered namespaces (/somenamespace/) I succeed to generate the Update program and to integrate it in my Z-programs as well.
    My question is: is it possible to use Change Document Object-names without predefined namespace - being a regular customer developer, but not an SAP developer - means, if I am allowed to manage programs in the customer namespace (Z,Y, X) only. If yes, how to do this?
    Further (I decided not to open a new thread) - generated Update program uses
    CALL FUNCTION 'xxxxx' IN UPDATE TASK
    for creation of Change Numbers for generated Change Document Object. This CALL doesn't work when I implemented it in my Z-program, but when changed  (IN UPDATE TASK was commented) - everything goes well and the system creates records in CDHDR/CDPOS tables for my object class and table.
    Why is that? According to the documentation I shoud only fill appropriate variables for the Change Document Object (class, tr.code, etc.) and call generated FM, nothing is pointed out about any possible problems? Am I doing something wrong?
    Well, to be precise, I think I have to give a sample:
    1. I have a sample Z-table with few fields (their data elements are marked as Change-Document relevant).
    2. Using own z-progam I created a new record for this z-table. Also fill all the nessesary variables included in the interface of generated FM for Change Document Object (for example - FM-mane CD_CALL_my_object).
    3. I call the CDO FM.
    4. Check what is happening (directly in both tables CDHDR/CDPOS or using FM CHANGEDOCUMENT_READ).
    Further, I perfom the steps from 1 to 4 updating the created in previous loop record in my Z-table.
    In both cases if the FM 'CD_CALL_my_object' is called IN UPDATE TASK nothing happens, but in case of direct call (without addition IN UPDATE TASK) the system behaves as expected. Well, obliously I can change the generated code for our production needs, but it doesn't seems to be the correct decision - in case of next possible modification of the Change Document Object definition, respectively in need of re-generation of the code.
    Any hints are wellcome.
    Thanks in advance.
    Ivaylo Mutafchiev
    Edited by: Ivaylo Mutafchiev on Jan 24, 2008 10:24 AM

    "IN UPDATE TASK" resolved by myself. The one should explicitly call 'COMMIT WORK' from Z-program after CALL FUNCTION '...' IN UPDATE TASK in order to get changes in the CDHDR/CDPOS commited. The key in this issue for me was to check the documentation of CALL FUNCTION :-).
    Regards,
    Ivo

  • Accounting documents not generated in MIGO for Acct. ***.Category "A"

    Hi Friends,
    I have created a PO for Asset procurement. I have selected acct. ***. category as "A" in the PO. When I do the GR, the material document is getting generated but without any accounting document. Accounting docs are getting generated for other acct. ***. categories like for "F" and "K", but not in the case of "A".
    Please suggest where in the configuration should I check for this issue.
    Thanks & Regards
    Satya

    Dear Satya,
    Goto OME9, select your related AAC "A", then when you are maintaining PO with such AAC, the GR-non-valuated indicator will be set defaulted and greyed out (i.e. you can't be able to deactivate). If only GR-non-valuated indicator is set, then this indicator check box will be defaulted (but not greyed out) and therefore, you can change if you wish to. Yet, these settings are not relevant to the case of raising multi account assigned PO as in this particular case, SAP will automatically set the GR-non-valuated indicator check box regardless of if you have made any settings in OME9. Hope this could help you. TQ
    rgds,
    nanthakumar

  • Java mapping for Remove and Add of  DOCTYPE Tag

    HI All,
    i have one issue while the Java mapping for Remove and Add of  DOCTYPE Tag   in Operation Mapping .
    it says that , while am testing in Configuration Test "  Problem while determining receivers using interface mapping: Error while determining root tag of XML"
    Receiver Determination...
    error in SXMB MOni
    " SAP:Category>XIServer</SAP:Category>
      <SAP:Code area="RCVR_DETERMINATION">CX_RD_PLSRV</SAP:Code>
      <SAP:P1>Problem while determining receivers using interface mapping: Error while determining root tag of XML: '<!--' or '<![CDATA[' expected</SAP:P1>
    plz provide solutions
    Thanks in advance.

    Hi Mahesh,
    I understand, you are using extended Receiver Determination using Operational Mapping (which has Java Mapping). And, there is an error message u201CError while determining root tag of XMLu201D, when you are doing configuration test.
    Can you please test, the Operational Mapping (which has Java Mapping) separately in ESR, with payload which is coming now. It should produce a XML something like this [Link1|http://help.sap.com/saphelp_nwpi711/helpdata/en/48/ce53aea0d7154ee10000000a421937/frameset.htm]
    <Receivers>
    <Receiver>
      <Party agency="016" scheme="DUNS">123456789</Party>
      <Service>MyService</Service>
    </Receiver>
    <Receiver>
      <Party agency="http://sap.com/xi/XI" scheme="XIParty"></Party>
      <Service>ABC_200</Service>
    </Receiver>
    </Receivers>
    If it is not (I Think it will not), then there is some problem in Java Mapping coding. Please correct it. Last option, if your Java code is small in length; you may paste it here, so that we can have a look at the cause of issue.
    Regards,
    Raghu_Vamsee

  • Need you help to update business area for FI Document  generated  at migo

    HI guys
    I am looking for MIGO Badi or user-exit which will help update business area which is mandatory field but when movement type 101and the account assignment tab is not there when the movement type is 101 at the time of GR so i want to update it BA in for FI Document generate  in background so as to complete the GR. 
    Thanks

    Hi Niraj ,
    I Have check the badi but there is no structure of FI item data  generated for which i can insert the BA for the line item generated
    Thanks
    Regards
    Nilesh

  • EJB2JSP generated tags cause exception "no corresponding open tag for tag extension close"

    The EJB2JSP-Tool generated among others the following tag:
              <tag>
              <name>home-findByState</name>
              <tagclass>com.ubisag.swd.ejb.jsp_tags._MessageHome_findByStateTag</tagclass>
              <teiclass>com.ubisag.swd.ejb.jsp_tags._MessageHome_findByStateTagTEI</teicla
              ss>
              <info>attribute 'aState' expects java type 'int'</info>
              <attribute>
              <name>aState</name>
              <required>true</required>
              <rtexprvalue>true</rtexprvalue>
              </attribute>
              </tag>
              When I use it as follows, I get a compile exception
              weblogic.servlet.jsp.JspException: (line 11): no corresponding open tag for
              tag extension close: </message:home-findByState> file://[ null; Line: 11]
              The jsp-code is:
              <%@ taglib uri="/WEB-INF/swdejb-tags.tld" prefix="message" %>
              <ul>
              <message:home-findByState aState="1" _return="messages" >
              <li>
              <%=messages.getId()%>
              <%=messages.getText()%>
              </message:home-findByState>
              </ul>
              I would be thankful for every hint.
              

    Actually I'm getting this exception only, when I use attributes as
              parameter:
              <%
              int aState = 1;
              %>
              <message:home-findByState aState=<%= aState %> _return="messages" >
              <%=messages.getText()%>
              </message:home-findByState>
              I don't know what to do with this.
              "Nora Serinek" <[email protected]> schrieb im Newsbeitrag
              news:[email protected]...
              > The EJB2JSP-Tool generated among others the following tag:
              >
              > <tag>
              > <name>home-findByState</name>
              >
              >
              <tagclass>com.ubisag.swd.ejb.jsp_tags._MessageHome_findByStateTag</tagclass>
              >
              >
              <teiclass>com.ubisag.swd.ejb.jsp_tags._MessageHome_findByStateTagTEI</teicla
              > ss>
              > <info>attribute 'aState' expects java type 'int'</info>
              > <attribute>
              > <name>aState</name>
              > <required>true</required>
              > <rtexprvalue>true</rtexprvalue>
              > </attribute>
              > </tag>
              >
              > When I use it as follows, I get a compile exception
              >
              > weblogic.servlet.jsp.JspException: (line 11): no corresponding open tag
              for
              > tag extension close: </message:home-findByState> file://[ null; Line:
              11]
              >
              > The jsp-code is:
              >
              > <%@ taglib uri="/WEB-INF/swdejb-tags.tld" prefix="message" %>
              >
              > <ul>
              > <message:home-findByState aState="1" _return="messages" >
              > <li>
              > <%=messages.getId()%>
              > <%=messages.getText()%>
              > </message:home-findByState>
              > </ul>
              >
              > I would be thankful for every hint.
              >
              >
              

  • Generate Document Identifiers for each document

    Hi,
    I need to generate document identifiers for each document that is uploaded to the site.
    Now I am getting a bit confusion i.e.
    Should I create derived class that inherits from the Microsoft.Office.DocumentManagement.DocumentIdProvider abstract class and then implement all abstract members or
    Should I create derived class that inherits from the abstract class named Microsoft.Office.DocumentManagement.DocumentIdProvider and then override all of the virtual members
    Please share your ideas/thoughts on the same.
    Regards,
    Sudheer
    Thanks & Regards, Sudheer

    I would prefer you use Inbuild feature of sharepoint:
    http://office.microsoft.com/en-in/sharepoint-server-help/enable-and-configure-unique-document-ids-HA101790471.aspx
    http://msdn.microsoft.com/en-us/library/office/ee559302(v=office.14).aspx
    Use below article to get and attach that Unique id:
    http://social.technet.microsoft.com/Forums/sharepoint/en-US/b836a2b0-50f0-4f0a-8efd-4c713f6ed610/how-to-get-the-documentid-programmatically?forum=sharepointgeneralprevious
    You can also create documents sets programmatically:
    http://www.dotnetsharepoint.com/2013/10/how-to-create-document-set.html#.Uyu-faiSxEs

  • WS - "java.rmi.MarshalException: (1)Missing end tag for Body or Envelope"

    HI All,
    I'm new of this forum but I really hope you could help me solving the problem I have to connect Web Services and midlets.
    Somehow my configuration works with some services I've found online but when I invoke very simple services deployed on my server(s) I always have "java.rmi.MarshalException: (1)Missing end tag for Body or Envelope" exception"
    Let me add some more information to the problem:
    System Configuration:
    - JBoss (but I also tried axis) - standard installation (http/1.1)
    - WTK 2.5 (but I also tried 2.2) - standard installation
    - I tried "trusted" and "untrusted" security configuration of the servlet
    - Netbeans IDE 5.0 (to create both Midlets and WS)
    - WS uses document/literal as expected by JSR 172
    The midlet is created with no problems but at the time of invocation the server throws the above exception (which is part of rmi. remoteException)
    By monitoring the network both at client and server side I noticed that the information received is chuncked after 768 bytes. However, If the (soap) reponse is less than such value, I still have the error.
    Using Http/1.1. at the mobile side, the service does not return me anything (0kb) while if I set the mobile device to http/1.0, I get the above error.
    I really have to make the midlet running so any type of help will be really appreciated!!
    Thanks in advance

    Hi all,
    as many developers I have encountered the famous "java.rmi.MarshallException:(1)Missing end tag for Body or Envelope" during the development of my WS app for J2ME (JSR 172).
    It is correct that is the empty tag <soapenv:Header /> causing this error.
    To fix this error, it is necessary to stop the server to generate this empty header in the response stream.
    I have fixed this error for Axis2: unfortunaly it is necessary to modify a class in Axiom library. This library is used in Axis2 to produce the SOAP response, you can download the source code at http://ws.apache.org/commons/axiom/source-repository.html.
    Here the class to modify:
    axiom\modules\axiom-impl\src\main\java\org\apache\axiom\soap\impl\llom\soap11\SOAP11Factory.java
    by commenting the line 273 in the method called getDefaultEnvelope() to prevent the empty header insertion in SOAP response:
    public SOAPEnvelope getDefaultEnvelope() throws SOAPProcessingException {
            OMNamespace ns =
                    new OMNamespaceImpl(
                            SOAP11Constants.SOAP_ENVELOPE_NAMESPACE_URI,
                            SOAP11Constants.SOAP_DEFAULT_NAMESPACE_PREFIX);
            SOAPEnvelopeImpl env = new SOAPEnvelopeImpl(ns, this);
            //createSOAPHeader(env); the line to be commented
            createSOAPBody(env);
            return env;
        }Finally you have to recompile Axiom using Maven to obtain the fixed package axiom-impl.jar and to replace this package on the lib repository of your Axis2 server.
    A little tricky to fix this bug but now my app runs perfectly ;)
    Enjoy!
    Romain Pellerin
    http://www.gasp-mobilegaming.org

Maybe you are looking for

  • How to get current row value from table when press the submit button

    Hi, I want to get the current row value of SuccessionPlanId which is one of the column in a advanced table. I created one button (created using personalization, action fired thru CO)in the table as column, so each row having one button, if i press th

  • Payment Batch Not Working..

    Hi all, out of 802 payments which have equal Due Date, Pay Group, Payment Method ( at header and payment schedule level) bank ( all bank related information) every thing match in this 802 invoices. where in 800 got paid and 2 were left out. can you p

  • Upgrading to Weblogic 9.2

    Hi I'm upgrading an 8.1 app to 9.2. I've managed to deploy it, but when I try to access a web service I have deployed there it returns a 401 error, because it's trying to do basic authentication. It worked fine under 8.1. I tried adding <enforce-vali

  • Ibooks is no longer situated in iTunes how do I get it back?

    ibooks is no longer situated in iTunes how do I get it back?

  • Need more Java Analysis

    I have a few java books but none that give as many exercises as I need, is there a resource more in depth than the one on this site that gives exercises, and analysis as well as the written program? java.sun says it offers tutorials and hundreds of w