How Can Get DTD elements/Attribute In java

Dear Friends,
I want to get DTD Element in java Like by using DOM parser we can get Elements/Attribute in XML.
<!ELEMENT author (#PCDATA)>
<!ATTLIST author
     id (2 | 4 | 6) #REQUIRED
>
<!ELEMENT book (author, page)>
<!ATTLIST book
     id (1 | 2 | 3 | 4) #REQUIRED
     name CDATA #REQUIRED
>
<!ELEMENT library (book+)>
<!ELEMENT page (#PCDATA)>
By Example
i wants i can get elements library -> childs are book
book child have Attributes id and name..
how can i get .
pls help me
with regards
Siddharth singh

Build an XML-ORM then integrate it into the DOM, then have a nice day.

Similar Messages

  • How can get back my backup data from an external element ?

    How can get back my backup data from an external element ?

    See the section titled "restoring data from Time Machine backups" in this Apple support article; that should get you going.
    http://support.apple.com/kb/ht1427
    Regards.

  • How canI get my serial number for Elements 11?

    How canI get my serial number for Elements 11?  Does anyone know how to help me.  I did puchase it sometime ago but lost all computer data and had to replace computer.  Hope someone can help.
    Thanks
    Steve

    If you have no record of it at your end, the only place you might find it is at Adobe's end via logging into your Adobe account and seeing if it is listed there.  If you registered the software it should be.
    Beyond that your only hope might be to have Adobe support check your information to see if the software/serial number is available and if it can be given to you.  Try contacting them by chat or telephone.
    Here is a link to a page with options to help make contact:
    http://www.adobe.com/support/download-install/supportinfo/

  • How can I add an attribute to a node?

    Hi,
    How can I add an attribute to a node of a DOM Document?
    I want to add attribute Maximum="6" for all Grade node as <Grade Maximum="6">.
    Grade is a third level node in my document.
    Thanks

    Hi,
    How can I add an attribute to a node of a DOM
    Document?
    I want to add attribute Maximum="6" for all Grade node
    as <Grade Maximum="6">.
    Grade is a third level node in my document.
    ThanksGet the father of "Grade" elements as an element. Then get all elements named "Grade", and for each one set attribute "Maximum" with value "6". If you read api documentation you will know which methods to use.
    But for helping you in getting the "Grade" parent.
    1) get the root element of the Dom Doc
    2)get the father of the "Grade" father: getElementsBytagName("his name") -> it will return a Node List get the first element casting as Element if there's only one, or elese if not case
    3)the same method in 2 get the "Grade" father
    4)getElementByTagName("Grade") over the "Grade" father -> for each "grade" element on nodelist do whatever you need
    i hope u understood...

  • How can i add custom attributes to a new Class Object using the API ?

    Hello everyone,
    Here is my problem. I just created a subclass of Document using the API (not XML), by creating a ClassObjectDefinition and a ClassObject. Here is the code :
    // doc is an instance of Document
    ClassObject co = doc.getClassObject();
    ClassObjectDefinition cod = new ClassObjectDefinition(ifsSession);
    cod.setSuperclass(co);
    cod.setSuperclassName(co.getName());
    cod.setName("MYDocument");
    ClassObject c = (ClassObject)ifsSession.createSchemaObject(cod);
    Everything seems to be OK since i can see the new class when i use ifsmgr. But my question is : how can i add custom attributes to this new class ? Here is what i tried :
    AttributeDefinition value = new AttributeDefinition(ifsSession);
    value.setAttribute("FOO", AttributeValue.newAttributeValue("bar"));
    c.addAttribute(value);
    But i got the following error message :
    oracle.ifs.common.IfsException: IFS-30002: Unable to create new LibraryObject
    java.sql.SQLException: ORA-01400: impossible d'insirer NULL dans ("IFSSYS"."ODM_ATTRIBUTE"."DATATYPE")
    oracle.ifs.server.S_LibraryObjectData oracle.ifs.beans.LibrarySession.DMNewSchemaObject(oracle.ifs.server.S_LibraryObjectDefinition)
    oracle.ifs.beans.SchemaObject oracle.ifs.beans.LibrarySession.NewSchemaObject(oracle.ifs.beans.SchemaObjectDefinition)
    oracle.ifs.beans.SchemaObject oracle.ifs.beans.LibrarySession.createSchemaObject(oracle.ifs.beans.SchemaObjectDefinition)
    void fr.sword.ifs.GestionDocument.IFSDocument.createDocument(java.lang.String)
    void fr.sword.ifs.GestionDocument.IFSDocument.main(java.lang.String[])
    So, what am i doing wrong ?
    More generally, are we restricted in the types of the attributes ? (for example, would it be possible to add an attribute that would be an inputStream ? Or an object that i have already created ?).
    Any help would be appreciated. Thanks in advance.
    Guillaume
    PS : i'm using Oracle iFS 1.1.9 on NT4 SP6 and Oracle 8.1.7
    null

    Hi Guillaume,
    you're welcome. Don't know exactly, but assume that ATTRIBUTEDATATYPE_UNKNOWN
    is used to check for erronous cases only
    and it shouldn't be used otherwise.
    Creating your own objects could be simply done via
    ClassObject ifsClassObject;
    DocumentDefinition ifsDocDef = new DocumentDefinition(ifsSession);
    // get class object for my very own document
    ifsClassObject = ClassObject.getClassObjectFromLabel(ifsSession, "MYDOCUMENT");
    // set the class for the document i'd like to create
    ifsDocDef.setClassObject(ifsClassObject);
    // set attributes and content for the document...
    ifsDocDef.setAttribute("MYFOO_ATTRIBUTE",....);
    ifsDocDef.setContent("This is the content of my document");
    // create the document...
    PublicObject doc = ifsSession.createPublicObject(ifsDocDef);
    null

  • How can I convert the attribut lastLogon ...

    Hi,
    How can I convert the attribut lastLogon on an Active
    Directory Microsoft?
    Attributes ar = ctx.getAttributes(dn, attrs);
    if (ar != null) {
    for (int i=0; i<attrs.length; i++) {
    Attribute attr = ar.get(attrs);
    if (attr != null) {
    String values="";
    for ( Enumeration vals=attr.getAll();
    vals.hasMoreElements(); ) {
    values += vals.nextElement();
    if ( vals.hasMoreElements() )
    values += "\t";
    entry += SRV.SEPARATOR + values;
    When I take the value of the restrained attribut of the
    enumeration how I make convert it for example in a date ?
    I am using Windows2000 Advanced server.
    An example of lastLogon attribue is "126949578544450976".
    Any help is greatly appreciated.
    R.F.

    It looks to be the same format at accountExpires.
    If so, your in luck, I worked that one out back in January:
    http://forum.java.sun.com/thread.jsp?forum=51&thread=346718

  • How to get af:commandbutton id in java code when it is triggered?

    Hi All
    In my application's homepage, I am using 2 af:commandbuttons and each using action attribute to call a method. Both are calling the same method, and based on its id, it should perform different operations. Could anyone please tell me how to get command buttons id in java code, when it is triggered.
    Regards
    Venkat

    Venkat,
    why not call different methods from each button?
    public String actionButton1()
    return doAction("button1");
    public String actionButton2()
    return doAction("button2");
    public String doAction(String aBuuton)
    if ("button1".equalsIgnoreCase(aButton))
    // do work for button 1
    return "abc";
    }else {
    // do work for button 2
    return "abc";
    }Now you user actionbutton1 for the first button and actionButton2 for the second.
    Or you directly implement two different methods in the bean and call each one directly from the button.
    Timo

  • How can i execute Spaces API in java main class?

    Hi
    I am able to execute Spaces API through portal application. However if i try to execute it in java main class, its throwing an exception
    "SEVERE: java.io.FileNotFoundException: .\config\jps-config.xml (The system cannot find the path specified)"
    oracle.wsm.common.sdk.WSMException: WSM-00145 : Keystore location or path can not be null or empty; it must be configured through JPS configuration or policy configuration override.
    How can i set this path, so that i can execute Spaces API from java main class.
    Need this main class to configure in cron job, to schedule a task.
    Regards
    Raj

    Hi Daniel
    Currently i have implemented create functionality in my portal application using Spaces API, which is working fine. Now the requirement is, i need to implement a "Cron Job" to schedule a task, which will execute to create space(for example once in a week). Cron job will execute only the main method. So I have created java main class, in which I have used Spaces API to perform create space operation. Then it was giving exception.
    Later I understood the reason, as I am executing the Space API with a simple JSE client, its failing since a simple java program has no idea of default-keystore.jks, jps-config.xml, Security Policy. Hence i have included those details in main class. Now I am getting new error,
    SEVERE: WSM-06303 The method "registerListener" was not called with required permission "oracle.wsm.policyaccess"
    For your reference i have attached the code below, please help. How can i use Spaces API in java main method(i mean public static void main(String[] args) by giving all required information.
        public static void main(String[] args) throws InstantiationException,
                                                      GroupSpaceWSException,
                                                      SpacesException {
            Class2 class2 = new Class2();
            GroupSpaceWSContext context = new GroupSpaceWSContext();
            FactoryFinder.init(null);
            context.setEndPoint("http://10.161.226.30/webcenter/SpacesWebService");
            context.setSamlIssuerName("www.oracle.com");
            context.setRecipientKeyAlias("orakey");
            Properties systemProps = System.getProperties();
            systemProps.put("java.security.policy","oracle/wss11_saml_or_username_token_with_message_protection_client_policy");
            systemProps.put("javax.net.ssl.trustStore","C:\\Oracle\\Middleware11.1.7\\wlserver_10.3\\server\\lib\\cacerts.jks");
    systemProps.put("oracle.security.jps.config","C:\\Oracle\\Middleware11.1.7\\user_projects\\domains\\workspace\\system11.1.1.7.40.64.93\\DefaultDomain\\config\\fmwconfig\\jps-config.xml");
            systemProps.put("javax.net.ssl.keyStore",C:\\Oracle\\Middleware11.1.7\\user_projects\\domains\\workspace\\system11.1.1.7.40.64.93\\DefaultDomain\\config\\fmwconfig\\consumer.jks");
            systemProps.put("javax.net.ssl.keyStorePassword", "Test12");
            System.setProperties(systemProps);
            GroupSpaceWSClient groupSpaceWSClient;
            try {
                groupSpaceWSClient = new GroupSpaceWSClient(context);
                System.out.println("URL: " +
                                   groupSpaceWSClient.getWebCenterSpacesURL());
                //delete the Space
                List<String> groupSpaces = groupSpaceWSClient.getGroupSpaces(null);
                System.out.println("GroupSpaces:: " + groupSpaces.size());
            } catch (Exception e) {
    Regards
    Raj

  • How can i select view attribute in a method

    hi how can i select view attribute in method and pass that attribute to procedure
        public void DeleteAgr(Integer agrid) {
                     ViewObject svo = this.findViewObject("AGR");
                     //select current view id from agr and link id with agrid          
                    callPerformSdmsLogon("SMS_FORM_TO_ADf.delete_agr(?)", new Object[] { agrid });
    }Edited by: Tshifhiwa on 2012/06/30 1:01 PM
    Edited by: Tshifhiwa on 2012/06/30 1:22 PM
    Edited by: Tshifhiwa on 2012/06/30 1:24 PM

    hi i use your sample but now am geting this errror (oracle.jbo.JboException) JBO-29000: Unexpected exception caught: java.lang.NullPointerException, msg=null
    ----- Level 1: Detail 0 -----
    (java.lang.NullPointerException) null check the code below
                              public String getCurrentagrid(String currentagrId) {
                            if (currentagrId != null && currentagrId.length() > 0) {
                                ViewObjectImpl agrVO =
                                    this.getAGR1();
                                if (agrVO != null) {
                                    Key key = new Key(new Object[] { currentagrId });
                                    //Searching for the row with key
                                    //getRow(key) will search in the cache which contain atmost
                                    //2000 records Becoz the MaxFetchSize of EmpVO is 2000
                                    AGRRow agrRow =
                                        (AGRRow)agrVO.getRow(key);
                                    //if the record with key is not present in the cache
                                    if (agrRow == null) {
                                        //Searching for the row with key in the DataBase
                                        //findByKey() searches in DB
                                        Row[] agrRows = agrVO.findByKey(key, 1);
                                        if (agrRows != null && agrRows.length != 0) {
                                            //agrRows = (AGRRow)agrRows[0];
                                    if (agrRow  != null) {
                                        //currentagrId = (String)agrRow.getAttribute("id");
                                        //agrVO.executeQuery();
                                        //agrRow = agrVO.first();
                                        callPerformSdmsLogon("SMS_FORM_TO_ADf.delete_agr(?)", new  Object[] { currentagrId });
                            return currentagrId ;
                        }Edited by: Tshifhiwa on 2012/07/01 10:51 AM
    Edited by: Tshifhiwa on 2012/07/01 11:38 AM

  • Imported slide show into PE11 and some pics rotated unexpectedly, How can get back to horizontal?

    Imported slide show into PE11 and some pics rotated unexpectedly, How can get back to horizontal?

    winkhi
    Just what are the pixel dimensions of these photos that are automatically rotating on you in Premiere Elements 11 workspace after being transferred there from the Elements Organizer Slideshow Editor? Do I have that correct? If so, how are you making the transfer....Edit with Premiere Elements Editor, Burn to Disc, or other as Elements Organizer 11 Slideshow Editor output?
    What is the scenario...from the camera to the computer hard drive, landscape; from the computer hard drive to the Elements Organizer 11 Slideshow Editor, landscape; from the Elements Organizer 11 Slideshow Editor to Premiere Elements 11 Project Assets/Timeline, rotated to Portrait?
    Do you find that the frequency of the problem is related to pixel dimensions, number of photos used? What is the format of these photos, jpg or other?
    Are you using the Rotation option in the Applied Effects Tab/Applied Effects Palette/Motion Panel expanded to correct the photo rotation?
    Just some thoughts for now.
    ATR
    ATR

  • How can I check what version of Java Web Start is installed on the client ?

    hi,
    Can anyone tell me how can I check what version of java web start is installed on the client and display a message if the client has not the good version ?
    I mean:
    I'd like all people running my application use java 5 and if someone using java 1.4 try to run the application get a nice screen telling him to download the latest version of Java Web Start.
    Is this possible ?
    Thanks in advance.

    Of course, I put this on my jnlp file,
    <resources>
        <j2se version="1.5+"/>
        <jar href="..... "/>
    </resources> But even with that, it doesn't display a nice message but a kind of exception instead.
    Thanks in advance.

  • How to get one element of a database with database toolkit

    I am working with an access database in which I want to store information about all the computers that recide in a network. The information that I will store in this database is computer's IP address, computer name, etc. Now I want to look in my database the ip address of the computers and get the ip of every one as a string. What I'm trying to do is to convert the output variant of the block "get" to a two dimensional array for then convert it to a matrix in which I can get the elements one by one. Attached is the vi in which I'm working. If you can help me to figure out how to solve my problem I'll be very happy and if I am not in the indicated discussion forum please guide me to find the correct one.
    Attachments:
    Getting just one element.vi ‏11 KB

    Well I found this post that answered my question
    http://forums.ni.com/t5/LabVIEW/how-to-get-records​et-from-database/m-p/1471374?requireLogin=False

  • How can get a Graphics to draw line on screen?

    How can get a Graphics to draw line on screen?
    Now, I can get a Graphics to draw line based on component. For example JPanel, but I want to get a Graphics to draw line on screen.

    By drawing on the screen, I assume you mean drawing outside the bounds of a top-level window like
    JFrame or JDialog. You can't do that. At least, without going native and even then that's a dodgey thing
    for any platform to let you do. One thing you can do is simulate it with a robot's screen capture:
    import java.awt.*;
    import java.awt.event.*;
    import java.awt.image.*;
    import javax.swing.*;
    public class X {
        public static void main(String[] args) throws Exception {
            Rectangle bounds = GraphicsEnvironment.getLocalGraphicsEnvironment().getMaximumWindowBounds();
            BufferedImage image = new Robot().createScreenCapture(bounds);
            Graphics2D g2 = image.createGraphics();
            g2.setStroke(new BasicStroke(20));
            g2.setPaint(Color.RED);
            g2.drawLine(0, 0, bounds.width, bounds.height);
            g2.drawLine(bounds.width, 0, 0, bounds.height);
            g2.dispose();
            JLabel label = new JLabel(new ImageIcon(image));
            label.addMouseListener(new MouseAdapter(){
                public void mousePressed(MouseEvent evt) {
                    System.exit(0);
            JFrame f = new JFrame();
            f.setUndecorated(true);
            f.getContentPane().add(label);
            f.setBounds(bounds);
            f.setVisible(true);
    }

  • How can I call external exe in java

    Hi ,
    Is It Possible to call external exe in java.
    I read Runtime.exe("some exe") but actually my exe expects some input to process for that how can i pass the input to my exe and how can get the response from exe to my java class.
    any sample code is welcome.
    Thanks
    Babu H

    example
    import javax.swing.*;
    import java.awt.*;
    import java.awt.event.KeyAdapter;
    import java.awt.event.KeyEvent;
    import java.io.*;
    public class RuntimeExample extends JFrame {
        private JTextArea textArea;
        private JTextField textField;
        private PrintWriter writer;
        public RuntimeExample()
            init();
            initProcess();
        public void init()
            textArea = new JTextArea(20, 80);
            textArea.setEditable(false);
            textField = new JTextField(30);
            textField.addKeyListener(new KeyAdapter()
                public void keyPressed(KeyEvent event) {
                    if (event.getKeyCode() == KeyEvent.VK_ENTER)
                        if (writer != null)
                            textArea.setText("");
                            writer.print(textField.getText() + "\r\n");
                            writer.flush();
                            textField.setText("");
            Container container = getContentPane();
            JScrollPane scrollPane = new JScrollPane();
            scrollPane.setViewportView(textArea);
            container.add(scrollPane, BorderLayout.CENTER);
            container.add(textField, BorderLayout.SOUTH);
            setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            pack();
            textField.grabFocus();
            setVisible(true);
        public static void main(String[] args) {
            new RuntimeExample();
        public void initProcess()
            Runtime rt = Runtime.getRuntime();
            try
                //Process p = rt.exec(new String [] {"cmd", "/C", textField.getText()});
                //textArea.setText("");
                //textField.setText("");
                Process p = rt.exec("cmd");
                writer = new PrintWriter(p.getOutputStream());
                Thread thread1 = new Thread(new StreamReader(p.getErrorStream()));
                Thread thread2 = new Thread(new StreamReader(p.getInputStream()));
                thread1.start();
                thread2.start();
                System.out.println("Exit Value = " + p.waitFor());
            catch (Exception ex)
                textArea.append(ex.getMessage());
                ex.printStackTrace();
        public class StreamReader implements Runnable
            InputStream is;
            public StreamReader(InputStream is)
                this.is = is;
            public void run()
                try
                    BufferedReader reader = new BufferedReader(new InputStreamReader(is));
                    String data;
                    while ((data = reader.readLine()) != null)
                        textArea.append(data + "\n");
                    reader.close();
                catch (IOException ioEx)
                    ioEx.printStackTrace();
    }you can pass input to the exe by using getOutputStream() from Process and get the output from getInputStream() from Process

  • How can get Information of Exfect in Illustrator by Script?

    Illustrator can setting Effect: Illustrator Effect, Photoshop Effect to Object,
    But i find in document not exist attributes can get their information.
    How can get Information of Exfect in Illustrator by Script?

     

Maybe you are looking for

  • All of my itunes library has gone. My Music/video files are still there.

    Can I put all of the tracks/videos on with the play count/playlists still there? Hi, I have just turned on my computer, then itunes. What I found was nothing. I store all my files on an external hard drive and wasn't connected when I first loaded it

  • Canon 5D Mark III -- Lightroom 4.1 - Edit in Adobe Photoshop not working

    Hello, I appoligize if this has already been answered, I couldn't find a solution.  I have the new Canon 5D Mark III, and I updated to Lightroom 4.1 so I can import the 5D3 RAW image into LR.  But when I go to "Edit in Adobe Photoshop CS5" or "Merge

  • Nano memory space

    so i bought the 4gb nanopod though when i went put songs on it, it could only fit around 2.02 gb or such???! does anyone have/did have a similiar problem that they have solved? any help would be much appreciated

  • Infoset Query based on 0023 IT

    Hi, I have created one infoset query for infotype 0023. When I am executing this report for all the employees I can see the records. But if I select just one employee only blank fields are coming. Samriddhi

  • Ejb-jar files directory in WLS console

    Hi , Everyone I 'll like to know that's the meaning of "\.\" in the following directory which found in Weblogic 7 console. I just clicked: mydomain | delplyment | EJB | a4b2.jar D:\bea\user_projects\mydomain\.\myserver\upload\a4\a4b2.jar