How to set Document Type Declaration of xml Document?

Hi,
I am referring to "org.w3c.dom.Document".
How can we set the Document Type Declaration (DTD) of a document?
Thanks.

Hi,
But when we have to create a document(org.w3c.dom.Document) dynamically, and that document has to be validated against a DTD......How can we do it?
I am using the following code
DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
DocumentBuilder builder = factory.newDocumentBuilder();
DOMImplementation domi = builder.getDOMImplementation();
DocumentType docType = domi.createDocumentType("query", null, "c:\\queryDtd.dtd");
Document doc = domi.createDocument(null, "query", docType);But this code is not working. Resulting document is not having <!DOCTYPE...> tag
I have to build a Doument object (not xml file) whose content is as below
<?xml version='1.0' encoding='utf-8'?>
<!DOCTYPE query SYSTEM "queryDtd.dtd">
<query id="abc123">
     <data-source-name>EmployeeDB</data-source-name>
     <fields>
                 <field>id</field>
                 <field>name</field>
                 <field>salary</field>
                 <field>joindate</field>
     </fields>
     <fetch-limit>10</fetch-limit>
</query>

Similar Messages

  • How to set the root path of XML document when calling Inserting procedure

    Hi,
    I was create a procedure to insert XML Document in to DBMS Tables, but i am not able to set the Start root element in calling procedure.
    My calling procedure is
    exec insXmldoc('pmc_sample.xml', 'pmc')
    When i am calling this procedure i got this error
    11:23:54 Error: ORA-29532: Java call terminated by uncaught Java exception: oracle.xml.sql.OracleXMLSQLException: Start of root element expected.
    ORA-06512: at "SYS.DBMS_XMLSAVE", line 65
    ORA-06512: at "SCOTT.INSPROC", line 8
    ORA-06512: at line 2
    I am checking my XML file using XML Validator. My XML file was parsed with out errors.
    Please give the solution,and tell me where i did wrong in my calling procedure.
    suppose i have this XML file in local E drive ,how to set the path for that XML file in my calling procedure.

    Hi, I am doing the code likthis,please give the solution.
    SQL> create or replace procedure insProc(xmlDoc IN CLOB, tableName IN VARCHAR2) is
    2 insCtx DBMS_XMLSave.ctxType;
    3 l_ctx dbms_xmlsave.ctxtype;
    4 rows number;
    5 begin
    6 insCtx := DBMS_XMLSave.newContext(tableName); -- get the context handle
    7 rows := DBMS_XMLSave.insertXML(insCtx,xmlDoc); -- this inserts the document
    8 DBMS_XMLSave.closeContext(insCtx); -- this closes the handle
    9 end;
    10 /
    Procedure created.
    SQL> begin
    2 insProc('/usr/tmp/ROWSET.xml', 'emp');
    3 end;
    4 /
    begin
    ERROR at line 1:
    ORA-29532: Java call terminated by uncaught Java exception: oracle.xml.sql.OracleXMLSQLException:
    Start of root element expected.
    ORA-06512: at "SYS.DBMS_XMLSAVE", line 65
    ORA-06512: at "SCOTT.INSPROC", line 7
    ORA-06512: at line 2
    Kishore B

  • How to set variable value in an XML array

    Hi,
    Please let me know how to set the value for a xml array element using assign activity inside a for-each block in BPEL 11g
    I tried to set the variable value for result element using the below condition but i encountered selection failure message
    $outputVariable.payload/ns1:Student['i']/ns1:result or
    $outputVariable.payload/ns1:Student[$i]/ns1:result
    And the xsd used is as below
    <xsd:complexType name="StudentCollection">
    <xsd:sequence>
    <xsd:element name="Student" type="Student" minOccurs="0" maxOccurs="unbounded"/>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="Student">
    <xsd:sequence>
    <xsd:element name="Name" type="xsd:string"/>
    <xsd:element name="location" type="xsd:string"/>
    <xsd:element name="mark" type="xsd:string"/>
    <xsd:element name="result" type="xsd:string"/>
    </xsd:sequence>
    </xsd:complexType>
    Thanks,
    Dhana

    Hi,
    At the back of button specify the following parameter:-
    CMD    1        Execute_planning_function
    Planning_function_name  1   xyz
    Var_name     1    variable_name
    var_value      1    blank
    Can also refer to link below:-
    http://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/b0a89464-f697-2910-2ba6-9877e3088954?quicklink=index&overridelayout=true(can refer to page 20)
    http://www.sdn.sap.com/ddc5564a-337d-4cf9-a34e-2dab64df09be/finaldownload/downloadid-a61a6724ba8e7b7fbd9c5df9590ab50d/ddc5564a-337d-4cf9-a34e-2dab64df09be/irj/scn/go/portal/prtroot/docs/library/uuid/f0881371-78a1-2910-f0b8-af3e184929be?quicklink=index&overridelayout=true
    Hope it may help

  • How to set field type choice using csom (c#)

    I have a field type: Choice (menu to choose from) which is not multichoice. How do I set a value?
    I have found code for multiple choice but it doesn't seem to work for single choice.

    Hi,
    The following code snippet for your reference:
    newListItem["ChoiceFieldName"] = "ChoiceValue";
    newListItem.Update();
    clientContext.Load(newListItem);
    clientContext.ExecuteQuery();
    If you are assigning a Value which is not in the Choice Column, You need to create a choice value then assign it to the item.
    More information is here:
    http://sharepoint.stackexchange.com/questions/124999/how-to-set-field-type-choice-using-csom-c
    Best Regards
    Dennis Guo
    TechNet Community Support

  • How to set dynamic color , based on xml element

    Hi,
    We have a requirement, where based on certain conditions, a cell will be shown in a specific color. We would like the coloir to be based on an XML element. The xml element will have values like '#FF00FF' etc..
    We tried using xsl attribute with the following syntax ,
    <xsl:attribute xdofo:ctx="block"name="color"><?stdcolor?></xsl:attribute><?end if?>
    where stdcolor is the xml element, but when we use this , this is giving a syntax error.
    Let us know, if this is possible or is there any other alternate way to do this.
    Regards,
    - Vasu -

    Hi Vasu,
    http://winrichman.blogspot.com/2008/09/how-to-set-dynamic-color-based-on-xml.html
    use the following :)
    <xsl:attribute xdofo:ctx="block" name="color" ><xsl:value-of select="stdcolor" /></xsl:attribute>
    TO get the colors you wanted , you can refer to
    http://www.w3schools.com/Html/html_colors.asp

  • I download itext  for convert jsp to PDF. How to set content type for PDF.

    I download itext for convert jsp to PDF. How to set content type for PDF. I try
    <%@ page contentType = "application/pdf;charset=TIS-620" %>
    , but the page does not PDF.
    Thank.

    PDF files are usually binary files, JSPs are not well-suited for binary content.
    (If you download the result of your JSP you'll see that it is not a valid PDF file; it will have probably a lot of whitespace and linefeeds, that will choke your PDF reader.). The first few characters must be
    "%PDF-" without whitespace.
    You can try using PDF files encoded as text - check if you can use text-encoded PDFs in iText.
    Try using a Servlet instead.

  • How to set Screen type "Selection Screen" in Dialog program

    Hi Experts,
    I have copied a screen 400 from a program into my program. In that screen in source program, the screen type was defined as 'Selection Screen'. After i copied that screen into my program, the screen type Selection Screen option is disabled. How to set the screen type of a screen to Selection Screen.
    I am currently getting the following error
    "Error when generating the selection screen "0400" of   "Ztest_screen                 ".
    I tried running the generation program RSDBGENA. There the diagnosis was given as follows:
    When generating the report Ztest_screen and its selection screen, an existing screen 1000 (not a selection screen) was overwritten.
    The selection screen was defined as follows:
    SELECTION-SCREEN BEGIN OF SCREEN 400 AS SUBSCREEN.
    SELECTION-SCREEN BEGIN OF BLOCK blck1 WITH FRAME TITLE text-001.
    SELECT-OPTIONS: s_matnr FOR mara-matnr.
    PARAMETERS:     p_werks TYPE werks_d OBLIGATORY.
    SELECTION-SCREEN END OF BLOCK blck1.
    SELECTION-SCREEN END OF SCREEN 400 .
    I am calling the screen 400 with selection screen declarations in PBO of screen 0100.
    CALL SUBSCREEN sub_scr INCLUDING 'Ztest_Screen'  '400'.
    Where am i going wrong? Your inputs are needed.
    Thanks

    Thanks Przemysław and Nabheet for your suggestions.
    I had copied the generated screen 400 also from the source program into my program. This was the error. I deleted that and the report got activated now.
    Both the source and destination programs are not module pool. They are executable programs.
    Thanks

  • How to set container type in PHP

    Hello, I wanna to set the type of container to be XmlContainer::WholedocContainer. However it did not work, the php warnning "Fatal error: Undefined class constant 'WholedocContainer'". The book named The Definitive Guide to Berkeley DB XML told that the delimiter in php was replaced by underscore. But this guide leads php completely fall. How could I do to correctly set up the parameter? Thanks
    Edited by: user10993398 on Dec 14, 2009 5:36 PM

    Hi,
    Here is an example for dbxml-2.5.13:
    <?   
    function initDbXmlSystem()   
        global $_REQUEST;   
        $envName  = "./tmp";   
        $contName = "result.dbxml";   
        $env      = new Db4Env();   
        $env->open($envName);   
        $mgr = new XmlManager($env, DBXML_ALLOW_EXTERNAL_ACCESS);   
        $config = new XmlContainerConfig();   
        $config->setTransactional(true);   
        $config->setContainerType(XmlContainer_WholedocContainer);   
        $mgr->setDefaultContainerConfig($config);   
        $cont = $mgr->createContainer($contName);   
    initDbXmlSystem();   
    echo "DONE";   
    ?> 

  • How to set content-type for outbound mail in BCS

    Hey everybody,
    can anybody please give me a hint how to set the content-type for outbound email in ABAP using BCS to send mail.
    By default the content tyoe is set to text/html. I need other.
    Best regards
    Roman

    //add related mutip-part to combine parts
    MimeMultipart multipart = new MimeMultipart("related");
    //attach a pdf
    messageBodyPart = new MimeBodyPart();
    fds = new FileDataSource("h:/something.pdf");
    messageBodyPart.setDataHandler(new DataHandler(fds));
    messageBodyPart.setFileName(fds.getName());
    multipart.addBodyPart(messageBodyPart);
    //add multipart to the message
    message.setContent(multipart);
    //send message
    Transport.send(message);

  • How to use the types declarations in smartforms

    hai
      already i declared the types in smartfomr global defination, how to call the types to the internal table and workarea, in which please i declare the internal table and work area by using the types structures
    for example
    types: begin of ty_kna1,
              kunnr type kunnr,
              name1 type name1,
              land1 type land1,
             end of ty_kna1.
    how to call the above types to internal table and work area in simartforms , in which place i declare the above types to the internal table and workarea

    Hi,
    Please see below
    **In Types tab
    types: begin of ty_kna1,
    kunnr type kunnr,
    name1 type name1,
    land1 type land1,
    end of ty_kna1.
    Types:ty_t_kna1 type standard table of ty_kna1.
    In Global data tab
    ***Internal table declaration
    data:i_kna1 type ty_t_kna1.
    ***Work area declaration
    data:wa_kna1 type ty_kna1.
    Regards
    Jana

  • How to set the value in the xml node.

    Hi
    I am having the application PDF which can be submitted by user using the button. while submitting 
    i am using below code to set the value in the xml node.
       xfa.data.assignnode("employee.id","123",0):
    So its generating the xml like below.
    <employee>.
    <id>123</id>.
    </name>
    </employee>
    Now i need to generate the xml like  below.
    <employee id= "123" >
      </Name>
    </employee>
    So how to set/create the id node like above?
    Advance Thanks.
    Regards,
    Dhiyane

    Hi Dhiyane,
    You will have to set the contains property if the id node to "metaData", that is;
    xfa.data.assignNode("employee.id","123",0);
    xfa.data.employee.id.contains = "metaData";
    Very clumsy if you have a number of them, in which case you might want to look at using E4X.
    Good luck
    Bruce

  • How to set task type of a task in MS Project using excel vba code.

    Hello Gurus,
    I am generating MS Project files(.mpp) files form excel data. An excel macro in the excel file will read the excel data and will generate the .mpp file. It is working fine. now i want to set the task type of all the tasks to "Fixed work" from excel
    vba code.
    How to use the property PjTaskFixedType in setting the task type??
    refer below links
    http://msdn.microsoft.com/en-us/library/office/ff861713.aspx
    http://msdn.microsoft.com/en-us/library/office/ff864157.aspx
    Can someone help me in setting task type property from excel vba.
    I have attached my sample code used to generate the mpp file. It is not the complete code but you will get an idea from it.
    Set pjApp = CreateObject("MSProject.Application")
    pjApp.FileNew
    Set newproj = pjApp.ActiveProject
    newproj.Tasks.Add (task_name)
    newproj.Tasks(mpp_row_number).Start = task_start_date
    newproj.Tasks(mpp_row_number).Finish = task_end_date
    newproj.Tasks(mpp_row_number).ResourceNames = resource_name
    pjApp.FileSaveAs mpp_file_save_path & mpp_file_name & ".mpp"
    pjApp.FileClose
    pjApp.Quit
    Any help is appreciated.

    Hi Syamku,
    A simple example that sets the task type:
    ActiveProject.Tasks(2).Type = pjFixedDuration
    ActiveProject.Tasks(3).Type = pjFixedUnits
    ActiveProject.Tasks(4).Type = pjFixedWork
    http://msdn.microsoft.com/en-us/library/office/ff860469(v=office.15).aspx
    Hope this helps

  • How to set MIME type for JNLP in Windows2000 IIS

    Hi!
    I try to set up my windows 2000 IIS's MIME type for JNLP to test java web start, but I have no idea how to set
    the MIME type. Can anybody help me???
    Best wishes

    In IIS v4 which comes with the Windows NT4 option pack, you right click the web page you are working with, select properties, then go to the HTTP Headers tab. At the bottom there's a button labelled File Types in the MIME Map section.
    After you've clicked that, you can add the two mime types you need;
    Associated Extension MIME Type
    .jar application/x-java-jar-file
    .jnlp application/x-java-jnlp-file
    I'm assuming that it is the same in W2k/IIS5.

  • How to set security type for lenovo working with hotspot?

    How to set wireless security type for lenovo laptop working with hotspot?
    Since I can connect with the other laptops except this brand.

    //add related mutip-part to combine parts
    MimeMultipart multipart = new MimeMultipart("related");
    //attach a pdf
    messageBodyPart = new MimeBodyPart();
    fds = new FileDataSource("h:/something.pdf");
    messageBodyPart.setDataHandler(new DataHandler(fds));
    messageBodyPart.setFileName(fds.getName());
    multipart.addBodyPart(messageBodyPart);
    //add multipart to the message
    message.setContent(multipart);
    //send message
    Transport.send(message);

  • VSTO: How to set line break in Ribbon Xml?

    Hi All,
    I have a button in Ribbon.xml. it looks like:
            <group label="myLabel" id="View">
              <checkBox id="cbView" label="ViewViewviewviewview" getPressed="cbView_Pressed"/>
            </group>
    The result is shown as:
    The checkbox is too long. My question is : How to set line break in checkbox's label.
    Thanks a lot,
    By the way, in Ribbon Xml. How to add RadioButton?

    Hello Ricky,
    The Fluent UI (aka Ribbon UI) doesn't provide any attribute or callback for that. You can try to use an escape sequence "\n\r", but I am not sure whether it helps. Also you may consider placing a text block below the check box control.
    You can read more about the Ribbon UI in the following series of articles:
    Customizing the 2007 Office Fluent Ribbon for Developers (Part 1 of 3)
    Customizing the 2007 Office Fluent Ribbon for Developers (Part 2 of 3)
    Customizing the 2007 Office Fluent Ribbon for Developers (Part 3 of 3)

Maybe you are looking for

  • Error in opening reports in OBIEE

    We are getting this error when opening reports in OBIEE State: HY000. Code: 10058. [NQODBC] [SQL_STATE: HY000] [nQSError: 10058] A general error has occurred. Unable to find library 'libclntsh.so.9.0'. [nQSError: 46029] Failed to load the DLL /u01/ap

  • Vector Mask Feather

    When I use the feather options on a Vector mask, it works but when I save the file, close it and open it again the feather settings are reset back to zero. I am using Photoshop CS4 Extended on windows XP. I saw that a mac user was having the same pro

  • No images in Safari 4.0.3

    Hello, I seem to be the only person having this problem in the entire internet... After upgrading Safari to 4.0.3 it no longer displays images. Everything else is fine, sites load OK, flash is there, but there is no images. The only input manager I h

  • Access-list port range question

    Hi, I would like to clarify the exact operation of the below command: /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-

  • Why can't I point the Video Importer to a specific USB drive directory

    When I (am force) to use the Video Importer (because my clips are on a USB drive) it seems to find and select all videos on this USB drive.  This is not what I want.  I want to browse to the directory (on the USB drive) that I created.  It contains t