How I get the SYSTEM Entities in a dtd

Hello,
i have some xml Files with the following content:
<?xml version="1.0" encoding="iso-8859-1"?>
<?xml-stylesheet type="text/xsl" href="style/webstyle.xsl"?>
<!DOCTYPE contentobject PUBLIC "-//Test//DTD Content v1.1 20021018//EN"
"dtd/content.dtd" [
<!ENTITY test1 SYSTEM "images/photo.gif">
<!ENTITY test2 SYSTEM "texts/hello.doc">
]>
<content>
</content>
Now I want to determine which Entities in the dtd are integrated.
The result should be:
test1, SYSTEM, "images/photo.gif">
test2, SYSTEM, "texts/hello.doc">.
I write the following code (JDK 1.4 Parser):
public static void getDocumentEntities(File xmlFile)
Document document = null;
try
DocumentBuilderFactory factory =
DocumentBuilderFactory.newInstance();
factory.setExpandEntityReferences(false);
DocumentBuilder builder = factory.newDocumentBuilder();
document = builder.parse(xmlFile);
DocumentType dtd = document.getDoctype();
if (dtd != null)
NamedNodeMap ent = dtd.getEntities(); // ????
for (int i = 0; i < ent.getLength(); i++)
Node node = ent.item(i);
System.out.print("Ent: " + node.getNodeName());
// System.out.print("NotationName: " + node.getn);
System.out.print(" PublicId: " + node.getNodeName());
System.out.println(" SystemID: " + node.getNodeName());
catch (Exception ex)
ex.printStackTrace();
The result is dissatisfactory.
First I get hundreds of Entities (probably from the dtd) and not only the two above.
Second I can`t get the path of the files for example "images/photo.gif"> .
Have anyone code for this problem? Should I use the DOM or SAX Parser for this?
I would be very happy, can anybody help me with this problem.
Much greetings, Theodore

Too difficult???
Please helped me.
Thank you, Theo

Similar Messages

  • How to get the system time in a Swing application ?

    I know how to do it in JavaScript, but not java. Please help me, and also how to get the system time in an Applet. Thanks !!!

    Check this link, I hope it helps
    http://202.71.136.142:8080/globalleafs/Swing/View.jsp?slno=22&tbl=0

  • How to get the system info in a network

    Hi to all.
    can any one tell me how to get the system related,like system name and logged user ,info in a network using java...
    thnx in advance,
    ashok

    There is quite a bit of data that is stored in the System Properties. Run this little test app and it'll display all of the System Properties, what you are looking for may be contained in there:
    public class Test {
        public static void main(String[] args) {
            System.getProperties().list(System.out);
    }

  • When plugging in an iPad in Apple Configurator, it is not being read under USB Connected so I can't update it.  Any ideas on how to get the system to read the iPad?

    When plugging in an iPad in Apple Configurator, it is not being read under USB Connected so I can't update it.  The iPhoto window opens up and reads the photos on the iPad, so it is connecting to the computer.  Earlier today I wasn't having any problems.  I have shut down the iPad and the computer and started over, but that didn't help.  Any ideas on how to get the system to read the iPad so I can update the apps on it?

    Hi, is the problem just to update your apps on your iPad? Here is what you should check. Is the iTunes on your computer updated to the latest version? Does your iPad needs to be updated? Do you have enough storage on your iPad to do the update? On your device is your iCloud back up checked?
    Go to Settings - iCloud - Backup/Storage - see if its checked, and try unchecking it before connecting it to the computer.
    Please let me know if you need any further assistance.

  • How to get the system specific hardware key.

    Hi all,
        I want to get the System specific hardware key(May be Hard disk related key which is unique for every System.) .Now i need to get it using a java program. if possible send me the related links and sample source code. pls help me out to resolve this issue.
    Regards,
    Kiran.

    hi,
       I can able to get the Mac address of computer using the java program. But when i am running a software called "PCQualifier.exe" i am getting the parameters like "uniqueID" and "unique code". so where and how he is getting those things please help me to get those things using a java programme. Any how i am sending the results that i have got after ruuning PCQualifier.Pls kindly help me out to resolve this issue.
    Computer Name  JAVADEV0005  
    Operating System  Windows XP 5.1 build 2600 (Service Pack 2)  
    Ethernet Details                   Name [00000008] Broadcom NetXtreme Fast Ethernet                   Adapter Type Ethernet 802.3                  
    MAC Address 00:11:25:F2:98:EF   
    Hard Disk Capacity    Total      39.06GB  
                          Used       84 %  
                          Free       6.16GB  
    RAM Capacity    Total      502 Mbyte  
                    Used       69 %  
                    Free       154 Mbyte  
    CDROM Status  CD-ROM Drive Present  
    USB Information   
    Total system supported Ports 0  
    Total Physical Ports 0  
    Total Devices Connected 0  
    Total Free Ports 0  
    Unique ID  5790315021  
    Unique Code  FNVVEFEFHIKO
    Thanks & Regards
    Kiran.

  • How to get the system date format string?

    Hello, everybody!
    I want to create a MaskFormatter with a mask for dates. So, I could suply as the constructor parameter: "##/##/####'. However, what if the year comes first in the current system date format settings, or the month is in the second place or in the first?... So, I can't just suppose that the current locale format for dates is like the one above. So, my question is: is there a way to get the SYSTEM DATE FORMAT STRING in Java? Searching in google I saw that this was already asked in this forum:
    http://forum.java.sun.com/thread.jspa?threadID=301034&messageID=1193794
    but there was no effective answer. Does someone already know how to get this?
    Thank you.
    Marcos

    Hi, not sure, but
    import java.text.*;
    SimpleDateFormat sdf = new SimpleDateFormat();
    System.out.println(sdf.toPattern());
    will output something like dd/MM/yy HH:mm
    hthThank you very much. It worked.

  • How to get the system date as a session attribute?

    Hi all,
    How can i get the system time and date to a session?
    This is my code:
    String startDate=<How will i get (system date) here?>;
    session.setAttribute("startDate",startDate);
    String startTime=<How will i get (system time + 1hr) here?>;
    session.setAttribute("startTime",startTime);
    Thanks in advance,
    Lakshma

    This is one way:
            Calendar cal = Calendar.getInstance();
            SimpleDateFormat sd1 = new SimpleDateFormat("yyyyMMdd");
            System.out.println(sd1.format(cal.getTime()));
            SimpleDateFormat sd2 = new SimpleDateFormat("hh:mm:ss");
            cal.add(Calendar.HOUR, 1);
            System.out.println(sd2.format(cal.getTime()));

  • How to get the system name of the client?

    Hi,
    I 've followed this Blog:
    https://www.sdn.sap.com/irj/scn/wiki?path=/display/snippets/getting%252blogged%252bin%252bportal%252buser%252bdetails%252bin%252bweb%252bdynpro
    getSAPUser() method returns the logged in user name.
    Is it possible to get the System name of the client?
    Thanks,
    RPN

    Hi,
    Following Code returns the System id :
    String sid = System.getProperty("SAPSYSTEMNAME");
                                       if(sid.equals("J2E")){
                                            //Do something                                   }
    Siddharth

  • How to get the system key in PL/SQL?

    Hi All,
    Is there a way to get master system key from PL/SQL?
    Thanks

    I am not sure about how to change SERVICE_NAME in PL/SQL Developer (if at all it can be done in that ), but you will have to change the SERVICE_NAME in the TNSNAMES.ORA file.
    1. Locate the entry for PLSExtProc in the file tnsnames.ora at:
    $ORACLE_HOME/network/admin/tnsnames.ora
    2. Change the SERVICE_NAME = ORCL
    3. Save and reconnect
    Aalap Sharma :)

  • # How to get the system AD Domain user login name in portal?

    when a system user use AD Domain method login the system.
    and then the user open the portal web application page, but not use AD Domain name login in portal page, that time ,I want to catch the user system login name show in portal page?
    I hava try the sereval method with Java or Jsp, or User Cookies ActiveX pulg,I get only the name of the portal hostname.
    so Anyone will provider me a well method to get the user login name?

    Elobrate more on ur problem

  • How to get the system property - user.name from a client system

    Hi All,
    I have an application which would enable active users from the domain of the company. I want to get the name of the client from the system. I tried to run it on the local machine from Jdeveloper, it returned me the correct user name. But when the application is deployed on the Oracle Application server, and i hit the URL of the application, it returns the server URL.
    I understand that the JSP works on the server side here but help me out to get a solution. I want to read the user name from the client side.
    Thanks in advance!
    Akhil

    Akhil,
    I hope this will never work. Think about your requirement for a second....
    This would mean an application is able to see my user credentials without my knowledge. It's bad enough the know my IP if I'm not using TOR.
    To get your requirement to work you have to redefine it a bit. The user have to log in to your application. The application holds the name together with an ID of the session to know the user in further requests.
    Thats a basic security theme, described in the dos [Adding Security to a Fusion Web Application|http://download.oracle.com/docs/cd/E12839_01/web.1111/b31974/adding_security.htm] .
    Timo

  • How to get the system time(hh:mm:ss) in jspx file itself.

    Hi I'm using jdeveloper 11.1.1.3.0.
    I am having one transient attribute in VO (data type is Timestamp and format is hh:mm:ss) and created the data control. Now I am drag and drop that attribute in one jspx file itself. if i run that page mean i need the current system time as a output. it ll automatically run in the output page(like digital clock - HH:MM:SS). how to implement this one plz help me sir.

    Hi john
    I got the output using the poll operation in the jspx file. But the mouse pointer is also updated(arrow mark and round alternatively). so how to stop the mouse pointer update.
    Regards
    Ragu

  • How to get the absolute path of a DTD referenced in an XML?

    Hello!
    My OS is Windows.
    I use "org.apache.xerces.parsers.SAXParser" which implements LexicalHandler to parse XML files. When method "startDTD" starts and "systemId" is got, how can I get the absolute path? Is there any simple way?
    Regards!

    Hi,
    http://forum.java.sun.com/thread.jsp?forum=34&thread=36
    612The methods in the above topic seem to be available when use a DOM parser..

  • How to get the system date and time using java

    hi,
    I want system date in my out put. how to access system date. can v use utill packaegs (or) sql. which one is the best to get.
    Thanks & Regards,
    Kenny.

    import java.util.Date;
    import java.util.Calendar;
    import java.util.GregorianCalendar;
    public class MyClass {
    public void setTimeStamp() {
    int hour, minute, second, time = 0;
    Date dt=new Date();
    System.out.println(dt.getDate());
    System.out.println(dt.getMonth());
    System.out.println(dt.getYear());
    Calendar cal = new GregorianCalendar();
    hour = cal.get(Calendar.HOUR_OF_DAY);
    minute = cal.get(Calendar.MINUTE);
    second = + cal.get(Calendar.SECOND);
    System.out.println (hour + ":" + minute + ":" + second);
    public static void main (String args[]){
    MyClass app = new MyClass();
    app.setTimeStamp();
    }

  • 0NOTIFICATN_ATTR datasource - how it get the system and user status

    Guys,
    I have 0NOTIFICATN_ATTR datasource bringing master data attribute of Notification document into BW. I saw it also bring the document system status and user status. But it only bring in the first status for each. i.e. for a notification document, it can has multiple system status (e.g. ATCO DLFL ...). this extractor only bring in 'ATCO'. while compare to the status DLFL (deletion flag), ATCO didn't really matter again.
    So, i am trying to find out how this datasource extract the status, how can i change the status field into a 40 chars field so i can keep all active status (as it shows in ECC, when user display the notification document status). Did anyone solve this case before?
    Thanks for the help.

    Hi,
    watch the following thread.
    how to extract equipment status in to bw
    and please refer following article by Vamsi
    http://www.sdn.sap.com/irj/scn/index?rid=/library/uuid/301941a0-25b4-2d10-6eb9-9758cbc28559
    It would be very useful.
    Thanks.

Maybe you are looking for

  • AirPrint in "grayscale

    How I can print from my iPad / iPhone with AirPrint in "grayscale"?.

  • Error: expected exactly one item, got 0 items

    Dear all, I've been facing the problem for long time. Please let me know the solution. Problem is as follows: BEA-382510: ALSB Assign action failed updating variable "stateResponse": com.bea.wli.common.xquery.XQueryException: Error parsing XML: {err}

  • Import e-mails to an iMac which has been exported from Windows Live mail and stored on a harddisk

    How do I import old emails to my íMAC that I have saved in Windows 7 and exported to with Windows Live Mail to a hard desk.?

  • Trouble swapping Ctrl/Alt [SOLVED]

    When I go to KDE's System Settings > Input Devices > Keyboard > Advanced, I try "Ctrl key position: Swap Left Alt Key With Left Ctrl Key". Nothing happens, Ctrl and Alt still do the same thing as before. This is a fresh Arch/KDE install so I may have

  • PL/SQL portlet with images

    We use a Portal Form to load images into the database. The field in the database is a BLOB. We do not know how to display the imagefield in PL/SQL. Can anyone explain to us how we can solve this problem? Lene & Anniken :o)