Include in XML Code

I'm not a XML guru and the only way I found to "include" a fixed xml part (in order to avoid to repeat it many times) is the & wich refers to an ENTITY in the DTD wich poins to an external file.
Sometime, however, the DTD can't be changed.
Could someone suggest me a workaround for that problem ?
TIA
Tullio

You can have internal DTD to specify the entities:
e.g.
<?xml version="1.0"?>
<!DOCTYPE foo SYSTEM "D:\jiwang\work_oracle\xml_sample\xmlparser\java\dom_dtd\test03.dtd" [
<!ENTITY sig "Jinyu" >
]>
<foo quux="This is quux">
This is &sig; foo
</foo>

Similar Messages

  • Including fixed Xml code

    I'm not a XML guru and the only way I found to "include" a fixed xml part (in order to avoid to repeat it many times) is the & wich refers to an ENTITY in the DTD wich poins to an external file.
    Sometime, however, the DTD can't be changed.
    Could someone suggest me a workaround for that problem ?
    TIA
    Tullio

    Would you please tell me more about in what scenario you need to include XML?
    You may also use the document() function in XSLT to include XML documents during transformation

  • Query in ASWE XML code doesn't return data

    Hello, since people on the Oracle Metalink site are to lazy to give an answer to this question. I'll try it via this forum. Here we go:
    I'm developing wireless applications running on Oracle9i Application Server Wireless Edition. I'v tried to implement the employee sample from Oracle Online Mobile Studio (studio.oraclemobile.com). The sample name is employee.jsp. This sample combines XML code with JSP.
    (code at the end of the text)
    When I test the sample I get no query results.
    When you take the first option for example, (search by dept number) the query result will not be displayed. I think it has something to do with the "executeQuery" line.
    rset = stmt.executeQuery("select * from EMP where EMPNO='" + empNum + "'");
    After giving the following input (employeenumber) 7369 (which excists in the
    database). I get the following errors:
    The panama server log returns the following error:
    1/14/02 5:19:28 PM NOTIFY : [Thread-13]
    core.XSLTransformerImpl.getXSLProc(XSLTransformerImpl.java:120)
    Create 10 number of XSL-processor for TINY_HTML
    1/14/02 5:19:35 PM NOTIFY : [Thread-15]
    adapter.URLAdapter.invoke(URLAdapter.java:240)
    URL = http://host/portal/test/employee.jsp
    1/14/02 5:19:37 PM NOTIFY : [Thread-17] adapter.URLAdapter.invoke(URLAdapter.java:240)
    URL =http://host/portal/test/employee.jsp?choice=empNum
    1/14/02 5:19:49 PM NOTIFY : [Thread-19]adapter.URLAdapter.invoke(URLAdapter.java:240)
    URL =http://host/portal/test/employee.jsp?&empNum=7369
    1/14/02 5:19:50 PM ERROR : [Thread-19]rt.common.Controller.reportServiceInvocationError(Controller.java:707)
    Service Invocation Error: Stream closed.
    The jserv.log returns the following error:
    [14/01/2002 17:19:50:431 CET] Invalid column name
    java.sql.SQLException: Invalid column name
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:168)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:210)
    at oracle.jdbc.dbaccess.DBError.throwSqlException(DBError.java:273)
    at oracle.jdbc.driver.OracleStatement.get_column_index(OracleStatement.java:4383)
    at oracle.jdbc.driver.OracleResultSetImpl.findColumn(OracleResultSetImpl.java:667)
    at oracle.jdbc.driver.OracleResultSet.getString(OracleResultSet.java:1374)
    at portal.test._employee._jspService(_employee.java:201)
    at oracle.jsp.runtime.HttpJsp.service(HttpJsp.java)
    at oracle.jsp.app.JspApplication.dispatchRequest(JspApplication.java)
    at oracle.jsp.JspServlet.doDispatch(JspServlet.java)
    at oracle.jsp.JspServlet.internalService(JspServlet.java)
    at oracle.jsp.JspServlet.service(JspServlet.java)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
    at org.apache.jserv.JServConnection.processRequest(JServConnection.java:402)
    at org.apache.jserv.JServConnection.run(JServConnection.java:260)
    at java.lang.Thread.run(Thread.java:479)
    Does this have something to do with the encoding of the query result in the select statement? As you can see the variable is in the requeststring (URL = http://host/portal/test/employee.jsp?&empNum=7369)
    My database connection works fine (I've also tested the query using SQL plus and the SQL adapter also works).
    Is this the right statement?: ("select * from EMP where EMPNO='" + empNum + "'");
    I can not do anything with the error in the jserv.log (java.sql.SQLException: Invalid column name).
    The columnname EMPNO excists in the example table. The query in SQL plus gives a result.
    Can someone give my any suggestions?
    Thanks in advance.
    Thomas Wesseling, UCC
    ### Code of employee.jsp ###
    <?xml version="1.0" encoding="UTF-8"?>
    <SimpleResult>
    <SimpleContainer>
    <%@ page language="java" import="java.sql.*, java.util.*, java.text.* "%>
    <%
    //URL variables
    String choice = request.getParameter("choice");
    String empNum = request.getParameter("empNum");
    String lastName = request.getParameter("lastName");
    String jobTitle = request.getParameter("jobTitle");
    String deptNum = request.getParameter("deptNum");
    String notFoundMsg = null; //String for containing varying not found msg
    DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
    Connection conn = DriverManager.getConnection("jdbc:oracle:thin:@172.16.0.51:1521:ora816", "scott", "tiger");
    Statement stmt = conn.createStatement();
    ResultSet rset = null;
    //**** Start of service - first card ****
    if (choice==null && empNum==null && lastName==null &&
    jobTitle==null && deptNum==null)
    %>
    <SimpleMenu title="Employee Search by:">
    <SimpleMenuItem target="employee.jsp?choice=empNum">Employee Number</SimpleMenuItem>
    <SimpleMenuItem target="employee.jsp?choice=lastName">Name</SimpleMenuItem>
    <SimpleMenuItem target="employee.jsp?choice=jobTitle">Job Title</SimpleMenuItem>
    <SimpleMenuItem target="employee.jsp?choice=deptNum">Dept Number</SimpleMenuItem>
    </SimpleMenu>
    <%
    //**** SECOND CARD - which search criteria ****
    if (choice!=null)
    if (choice.equals("empNum") && empNum == null)
    %>
    <!-- show search by employee number -->
    <SimpleForm target="employee.jsp?">
    <SimpleFormItem name="empNum" format="*N">Enter Employee Number: </SimpleFormItem>
    </SimpleForm>
    <%
    else if (choice.equals("lastName") && lastName == null)
    %>
    <!-- show search by last name -->
    <SimpleForm target="employee.jsp?">
    <SimpleFormItem name="lastName" format="*A">Enter Last Name: </SimpleFormItem>
    </SimpleForm>
    <%
    else if (choice.equals("jobTitle") && jobTitle == null)
    %>
    <!-- show search by job title -->
    <SimpleForm target="employee.jsp?">
    <SimpleFormSelect name="jobTitle" title="Enter Job Title:">
    <SimpleFormOption value="CLERK">Clerk</SimpleFormOption>
    <SimpleFormOption value="SALESMAN">Salesman</SimpleFormOption>
    <SimpleFormOption value="MANAGER">Manager</SimpleFormOption>
    <SimpleFormOption value="ANALYST">Analyst</SimpleFormOption>
    <SimpleFormOption value="PRESIDENT">President</SimpleFormOption>
    </SimpleFormSelect>
    </SimpleForm>
    <%
    else if (choice.equals("deptNum") && deptNum == null)
    %>
    <!-- show search by dept number -->
    <SimpleForm target="employee.jsp?">
    <SimpleFormItem name="deptNum" format="*N">Enter Dept Number: </SimpleFormItem>
    </SimpleForm>
    <%
    //**** THIRD CARD - query DB based on criteria ****
    //**** empNum entered as search criteria ****
    if (empNum != null) //empNum is entered as search criteria- NEED TO TEST FOR NON-int
    rset = stmt.executeQuery("select * from EMP where EMPNO='" + empNum + "'");
    if (rset.next()) //if rset returns data, show data
    do {
    %>
    <%@ include file="showResult.jsp" %>
    <%
    } while (rset.next());
    } //end rset.next() is true
    else
    notFoundMsg = "Employee Number " + empNum + " Not Found";
    %>
    <%@ include file="notFound.jsp" %>
    <% }
    } //end if empNum != null
    //**** lastName as search criteria ****
    else if (lastName != null)
    rset = stmt.executeQuery("select * from EMP where ENAME='" + lastName + "'");
    if (rset.next())
    do {
    %>
    <%@ include file="showResult.jsp" %>
    <%
    } while (rset.next());
    } //end rset.next is true
    else
    notFoundMsg = "Name " + lastName + " Not Found";
    %>
    <%@ include file="notFound.jsp" %>
    <% }
    } //end if lastName != null
    //**** jobTitle as search criteria ****
    else if (jobTitle != null)
    rset = stmt.executeQuery("select * from EMP where JOB='" + jobTitle + "'");
    if (rset.next())
    do {
    %>
    <%@ include file="showResult.jsp" %>
    <%
    } while (rset.next());
    } //end rset.next is true
    else
    notFoundMsg = "Job Title " + jobTitle + " Not Found";
    %>
    <%@ include file="notFound.jsp" %>
    <% }
    } //end if jobTitle != null
    //**** deptNum as search criteria ****
    else if (deptNum != null) //deptNum is entered as search criteria
    rset = stmt.executeQuery("select * from EMP where DEPTNO='" + deptNum + "'");
    if (rset.next())
    do {
    %>
    <%@ include file="showResult.jsp" %>
    <%
    } while (rset.next());
    else
    notFoundMsg = "Dept Number " + deptNum + " Not Found";
    %>
    <%@ include file="notFound.jsp" %>
    <% }
    } //end if deptNum != null
    conn.close();
    %>
    </SimpleContainer>
    </SimpleResult>
    ### Code of NotFound.jsp ###
    <SimpleText>
    <SimpleTextItem><%=notFoundMsg%></SimpleTextItem>
    <Action label="Search" type="ACCEPT" task="GO" target="employee.jsp?"></Action>
    </SimpleText>
    ### Code of ShowResult.jsp ###
    <%
    //format date from query
    java.sql.Date date = rset.getDate("HIREDATE");
    String hireDate = DateFormat.getDateInstance(DateFormat.MEDIUM).format(date);
    %>
    <SimpleText>
    <SimpleTextItem>Emp#: <%=rset.getString("EMPNO")%></SimpleTextItem>
    <SimpleTextItem>Name: <%=rset.getString("ENAME")%></SimpleTextItem>
    <SimpleTextItem>Job: <%=rset.getString("JOB")%></SimpleTextItem>
    <SimpleTextItem>Manager: <%=rset.getString("MGR")%></SimpleTextItem>
    <SimpleTextItem>Hire Date: <%=hireDate %></SimpleTextItem>
    <SimpleTextItem>Salary: <%=rset.getString("SAL")%></SimpleTextItem>
    <SimpleTextItem>Commission: <%=rset.getString("COMM")%></SimpleTextItem>
    <SimpleTextItem>Dept#: <%=rset.getString("DEPTNO")%></SimpleTextItem>
    <SimpleTextItem>Email: <%=rset.getString("EMAIL")%></SimpleTextItem>
    <SimpleTextItem>Phone: <%=rset.getString("PHONE")%></SimpleTextItem>
    <Action label="Search" type="SOFT1" task="GO" target="employee.jsp"></Action>
    <Action label="Call" type="OPTIONS" task="CALL" number="<%=rset.getString("PHONE")%>"></Action>
    </SimpleText>

    Is EMPNO really a string field and not a numeric field? Your query is like
    ... where EMPNO='1949'
    and should it perhaps be
    ... where EMPNO=1949
    ?

  • When printing a Lync Online Meeting from Outlook 2010, it prints out xml code?

    I have a couple of users that whenever they go to print out Lync 2010 Online Meetings from outlook 2010, it prints off a bunch of xml code and extra info (UCCCapabilities, UCInband, UCMeetingSetting, UCMeetingSent) all in XML.
    Any ideas why it would be doing this, and only affecting a couple of users?
    TAG

    The following fix worked in our Exchange 2010, Lync 2010, environment.
    Symptom
    In Outlook, when users are printing (or print previewing) Lync
    online meetings on shared calendars, an XML code is included in the printout.
    Cause
    When the shared calendar is opened, the folder is being
    reported as read-only despite the user having read-write permissions. The Lync
    add-in writes a property to the item (this succeeds) and then to the folder
    (this fails) so then the code is not run that would mark the property as the
    item as non-printable.
    Possible Resolution
    If the owner of the calendar creates an online meeting one time on their own calendar, this will
    result in the property being created in the calendar folder. Then when a
    delegate subsequently creates an online meeting on the calendar, the property
    will already be on the folder, so the Lync add-in will not try to add it. This
    avoids the error condition, and the property on the item will then be
    successfully flagged as non-printable.
    This worked for me. My user was a delegate for the managers mailbox. When she created an online Lync meeting on behalf of the manager, the meeting attendees would see the xml code in print preview as well as the printed document. The simple fix, as described
    above, was just to access the managers Outlook profile from the managers computer, and create and send out an online Lync meeting (to one or more recipients, shouldn't matter). That's it. Now when the delegate goes to create any new online Lync meeting on
    behalf of the manager, the visible code is no longer present. This works, as the description above says, because "the property will already be on the folder (after the manager creates an online Lync meeting on their own calendar), so the Lync add-in will
    not try to add it. This avoids the error condition."

  • How get and edit xml code of BI Publisher Report

    Hi to all,
    I need to do some costumization to one BI Publisher report. Investigating I found a solution to do my costumization. However this requieres edit the xml code. Can you please let me know how can I get and edit this code?
    Thanks in advance
    regards
    Daniel

    obiee / ebs .... ?
    Investigating I found a solution to do my costumization. However this requieres edit the xml code.
    no need edit seeded code (it's for SR)
    your steps:
    - get seeded code
    - edit
    - create custom report
    Can you please let me know how can I get and edit this code?
    for ebs you can look xml publisher responsibility, find by code

  • A class to format an XML string into indented xml code

    I am looking for a class or a piece of code to format an XML string into indented xml code
    for example: an XML string as follows
    <servlet><servlet-name>Login</servlet-name>servlet-class>ucs.merch.client.system.LoginServlet</servlet-class></servlet><servlet-mapping><servlet-name>Login</servlet-name>
    to format into :
    <servlet>
    <servlet-name>Login</servlet-name>
    <servlet-class>ucs.merch.client.system.LoginServlet</servlet-class>
    </servlet>
    <servlet-mapping>
    <servlet-name>Login</servlet-name>
    <url-pattern>/Login</url-pattern>
    </servlet-mapping>
    e-mail : [email protected]

    Xerces has a class called OutputFormat
    If you have your XML document in memory, you can format it using the method setIndenting(true) on the OutputFormat class. The following is an example:
    assuming xmlDoc is our document and fileName is the name of the file we wish to write to:
    OutputFormat format = new OutputFormat(xmlDoc);
    // setup output file name
    PrintWriter printwriter = new PrintWriter(new FileWriter(fileName, false));
    // construct an XMLSerializer for writing the document
    XMLSerializer serializer = new XMLSerializer( printwriter, format );
    // Ensure output is indented correctly...
    format.setIndenting(true);
    // set serializer as a DOM Serializer
    serializer.asDOMSerializer();
    // serialize the document
    serializer.serialize(xmlDoc);
    hope this helps!
    Rob.

  • XML report output displays xml code instead of pdf

    Hi,
    My Release is R12.1.1, An xml report whose output is set as pdf. when running this report output is coming as xml code instead of pdf
    another xml report ouput is coming in word instead of pdf
    is there any additional settings required to display in pdf format
    eventhough i configured pasta.csg & ixlib.cfg files
    Thanks,
    Alig
    Edited by: user12257829 on Jun 2, 2010 11:41 PM
    Edited by: user12257829 on Jun 2, 2010 11:41 PM

    Hi,
    Helios
    Even i tried both MOS documents u have referenced, as both reports compeleting normally without any error
    one thing i want to know can application use the same pasta.cfg file for pdf and text format
    as i have a single pasta.cfg configured
    Thanks
    Alig
    Edited by: user12257829 on Jun 3, 2010 1:18 AM
    Edited by: user12257829 on Jun 3, 2010 1:18 AM

  • How to Include JAVA script code in SAP BI7 web Reporting?

    How to Include JAVA script code in SAP BI7 web Reporting?

    In nw2004s there is a new web item called "Script" web item which lets you add javascript code. When you add javascript code in this web item, you don't need the opening and closing <script> tags...
    Hope it Helps
    Chetan
    @CP..

  • How to include my country code in the begging of every contact

    Dear all,
    i have phone contacts in a table with 13000 records, i want to update them and include my country code (968) in the beggining of every phone number.
    the length of our phone numbers are 8 charracter excluding country. like a typical phone number is below
    92752155
    i want to include 968 in the begging
    96892752155
    problem is that some numbers are short than 8 charachters, some are long then 8 characters (wrong data entry).
    i want to update only those numbers which have 8 character length, and dont have the 968 in the begging.
    how could i do that?
    i am using oracle 10g on windows 2003 server.
    thank you.

    think????
    SQL> with dat as
      2  (
      3  select '92752155' ph from dual
      4  union all
      5  select '9275215' ph from dual
      6  union all
      7  select '927521550' ph from dual
      8  union all
      9  select '96852155' ph from dual
    10  )
    11  select '968'||ph ph from dat
    12  where length(ph) = 8;
    PH
    96892752155
    96896852155
    SQL> with dat as
      2  (
      3  select '92752155' ph from dual
      4  union all
      5  select '9275215' ph from dual
      6  union all
      7  select '927521550' ph from dual
      8  union all
      9  select '96852155' ph from dual
    10  )
    11  select '968'||ph ph from dat
    12  where (length(ph) = 8 and ph not like '968%');
    PH
    96892752155
    Just have a look at the result and tell me how you THINK that it is correct!
    Regards,
    Jagdeep Sangwan

  • Target=_blank is not working in XML code

    Hi Experts,
    I have very basic question I am passing an extenal URL in XML code but target=_blank is getting ignored.
    <a href="http://localhost:8080/VikasSSO/Test.jsp" target="_blank">Click vikas</a>
    I done some research on it and found we can achieve it with java script only as target=_blank wont work directly in XML.
    Regards
    Vikas

    See the Data which is coming from AD and validate the type of your fields.
    Did you check connector logs ?

  • Problem with iTunes xml code

    I've been trying to change my feed url by adding the specified iTunes xml "new feed" tag at the channel level, but no matter where I put it, it invalidates the feed.
    This is my current feed:
    http://www.ultimathule.info/xml/UltimaThule_AmbientMusic.xml
    This is the xml I'm trying to add:
    <itunes:new-feed-url>http://www.ultimathule.info/xml/UltimaThule_AmbientRadio.xml</itunes:new-feed-url>
    Where exactly in my feed is this code supposed to go?
    George
    www.ultimathule.info

    You put this in your podcast's rss xml code right below the <channel> tag:
    <itunes:new-feed-url>http://yourserver_here/your_new_feedhere</itunes:new-feed-url>
    which I take to mean within the channel tag. If this is wrong, I hope to be corrected.

  • HTML & XML Code Stripped when loaded to web site

    Hi,
    I just loaded some page changes to my web site and the HTML & XML code was stripped when exported to my web site. I checked the site page code on the web site and it's absent.
    Has anybody had this happen and/or can anybody help me fix this problem.
    Thanks
    Malcolm

    Thank you for the response,
    This is the link to the page that didn't work. I left it the way was after I downloaded it to the web site is:   http://www.susystastebuds.com/Wedding/Wedding.html
    I have had this web site running under Dreamweaver for over a year without a problem and It has only just started to do this.
    Yahoo hosts my site and I do use the PUT action to post to the web.
    I have some Flash items on all my pages and some of them have stopped working properly, which I think means that some of the Flash code is not there either.
    I can go to Yahoo web page manger and upload each file and they page will work, but that is a very lengthy process.
    Thank you for any more help you can provide.
    Malcolm

  • Anyone know how to stop the "activate" box from blocking usage of a perfectly legal copy of Ilisten? I want to help my dyslexic grandson and this box, including the activation code, keeps popping up, keeping me from using the software. I activated the pro

    Anyone know how to stop the "activate" box from blocking usage of a perfectly legal copy of Ilisten? I want to help my dyslexic grandson and this box, including the activation code, keeps popping up, keeping me from using the software. I activated the program and did a few profile building sessions, now it pops up each time I start the program, blocking me from using it. Help sure would be appreciated.
    Jay

    I looked at your post this morning and did not know enough to respond, other than to find out that links to iListen now go to newer, renamed software. Considering it's been nine hours with no response, I'm suspecting few people here have experience with that software. You could contact the current copmany that used to sell that package and see if they have any archived support info.
    BTW: please check you entry for "Mac OS" in your profile. It says iOS, which cannot run on an iMac. iOS is the system for phone and iPads but can't run on Mac computers. Do "About this Mac" from the Apple menu and see what it says about the OS version. Should look like this:
    If the "Processor" line says "Intel," you have a newer Mac than the old modles this forum covers; Intel iMac have their very own forum here:
    iMac (Intel)

  • Xml code tables

    hi friends
    I have posted a thread before asking about the xml code
    i have got the answer that you have to go to the table MKPF.
    but i wanted to know that if another sceanrio comes and we have to get the details of the company, then invoice, PO and let it be anything how i can know which table to be used...
    please give me if there is any documents or list of tables for each BAPI used.
    thanks in adavance
    AK

    Hi,
    there is an easy way to get all those table names
    a) at first you need to know the process: Invoice, PO etc.
    b) then you do to TCODE BAPI
    c) then you open appropriate process and you can see
    all the bapis (like Create, display, getitems etc)
    d) click on those bapis and you will see the tables - in many
    cases these will be the ones that you have to use
    Regards,
    michal
    <a href="/people/michal.krawczyk2/blog/2005/06/28/xipi-faq-frequently-asked-questions"><b>XI / PI FAQ - Frequently Asked Questions</b></a>

  • Copying CRM_IC.XML Code

    I am trying to copy the Framework Profile "Default"  - IC WebClient - to my own (Z_FRAME_AA). During this process, I could not figure out how to copy the XML Code CRM_IC.XML to the Clipboard, and then paste it into a new file. Please let me know the procedure.

    Are you CRM 4.0 ?  Because CRM 5.0 is very user friendly .
    Try using Cntrl-Y to Select block of text and Copy.  I am not sure , just guessing.

Maybe you are looking for

  • Creating separate jars from one package structure

    Hello, I have the following package structure: project project.util project.mainAll of these packages are in the same classes directory. I would like to create one jar that contains project, one jar that contains project.util and one jar that contain

  • Approval Overview for SC and PO.

    Hi experts, we use SRM 7.0 with BRF workflow.  I need the approval data of SC and PO for such view in Mail: Approvingstep    Status       Approver        GID Approver purchaser          approved   John  Alex       z00000001 approver           approve

  • Pass HTML snippet TO JSPX page

    Hi I have a backing bean. In page's backing bean I have a small HTML snippet (that is small MenuBar functionality) that has come OUt of database. How can i pass this HTML snippet FROM this backing bean TO the jspx page ? Meaning this HTML snippet sho

  • DME - House Bank Settings

    hi all, What settings do i have to maintain in the Master data of House Banks and Bank Accounts for generating DME file in the Payment run? Regards

  • Comma-delimited values

    I need to load a flat file with lane and average cost which look slike below "AKRON, OH-ALSIP, IL",623.00 "AKRON, OH-BENTON HARBOR, MI",877.00 "AKRON, OH-FOGELSVILLE, PA",1187.00 "AKRON, OH-GRAND PRAIRIE, TX",2335.00 The lane value itself has comma i