Using ElementDecl to access the content model

Hi,
Suppose I have an DTD that looks like the following:
<!ELEMENT a (c*, d, e?, f+)>
<!ELEMENT c (#PCDATA)>
<!ELEMENT d EMPTY>
<!ELEMENT e (#PCDATA)>
<!ELEMENT f (g?, h+)>
<!ELEMENT g EMPTY>
<!ELEMENT h ANY>
How do you get the content model for each one of the elements
declared in this dtd? I tried to use the following code, but I
get strange results.
// Suppose edNode is the root of the DTD
org.w3c.dom.Node cmNode = edNode.getParseTree();
if (cmNode != null) {
System.out.println("edNode = "+edNode.getNodeName()+" -
"+edNode.getContentType());
System.out.println("Children...");
cmNode = cmNode.getFirstChild();
while (cmNode != null) {
System.out.println("cmNode = "+cmNode.getNodeName()+" -
"+cmNode.getNodeType());
cmNode = cmNode.getNextSibling();
Thanks in advance,
Renilton
null

Renilton Oliveira (guest) wrote:
: Hi,
: Suppose I have an DTD that looks like the following:
: <!ELEMENT a (c*, d, e?, f+)>
: <!ELEMENT c (#PCDATA)>
: <!ELEMENT d EMPTY>
: <!ELEMENT e (#PCDATA)>
: <!ELEMENT f (g?, h+)>
: <!ELEMENT g EMPTY>
: <!ELEMENT h ANY>
: How do you get the content model for each one of the elements
: declared in this dtd? I tried to use the following code, but I
: get strange results.
: // Suppose edNode is the root of the DTD
: org.w3c.dom.Node cmNode = edNode.getParseTree();
: if (cmNode != null) {
: System.out.println("edNode = "+edNode.getNodeName()+" -
: "+edNode.getContentType());
: System.out.println("Children...");
: cmNode = cmNode.getFirstChild();
: while (cmNode != null) {
: System.out.println("cmNode = "+cmNode.getNodeName()+" -
: "+cmNode.getNodeType());
: cmNode = cmNode.getNextSibling();
: Thanks in advance,
: Renilton
You code only descends to the first child node below the
root and processes only its sibling nodes. It never descends
below that layer to the child nodes below. Your code should
have another loop to correct this.
Oracle XML Team
http://technet.oracle.com
Oracle Technology Network
null

Similar Messages

  • An error occurred while accessing the content repository from JDeveloper

    Hello,
    I'm using Jdeveloper Studio Edition Version 11.1.1.5.0
    I created Content Repository conection, following:
    RIDC Socket Type: socket
    Server hostname: localhost
    Content Server Listener Port: 4444
    Executing "Teste Connection" result "Success!"
    But, trying connect, I receive:
    oracle.webcenter.content.internal.model.rc.AbstractRepositoryLogic listFolder
    An error occurred while accessing the content repository.
    and when I login to my portal and go to administration page, then I am getting this error
    "Messages for this page are listed below.
    Could not retrieve members from policy store.
    and when I go to services tab then i am getting this error "The Documents service is unavailable.
    Error contacting the content repository."
    Please help me to resolve this problem.
    Thank You,
    Muhammad Nasir

    can anybody help me to resolve this issue please.

  • Unable to access the content of a Window (PopUp)

    Hi,
    I am trying to access the contents of a MovieClip I placed
    inside a PopUpWindow component, but can't figure how to do that. I
    have created the window with something like this:
    var SAedit_win:MovieClip =
    mx.managers.PopUpManager.createPopUp(_root, Window, true,
    {closeButton:true, title:"Arterias Sistemicas",
    contentPath:"contentSA"});
    With this code, the window IS correctly created and the
    "contentSA" MovieClip (which is in the library) is correctly shown.
    However, I wanted to access objects inside "contentSA", but I can't
    find a way to do that. I have already tried:
    - SAedit_win.content (which is read-only...)
    - SAedit_win.contentsPath (which obviously didn't work)
    - SAedit_win.target
    - SAedit_win.contentSA
    Can anybody please help me with that?
    Tanks in advance
    JLonardoni

    I believe I was not very clear in my post... What I want is
    to address a MovieClip inside a Window component I created. I used
    the PopWindow Manager to create the Window instance, and attached
    the MovieClip using the contentPath variable. The problem is that
    now I have no reference to my MovieClip, and thus, I can't access
    objects inside it.
    Is there any other way to create a window using the Window
    component, so that I could have access to my MovieClip?
    Thanks again!

  • Can a HTML Widget access the content of a iBook page?

    I am writing a HTML Widget that will present more information about the content where it is located by accessing a database. To do so, it needs to access the content of the page where it located, or, at least, the page number. Is there a way to do this?
    Sure I can 'hard code' the info in the widget's javascript and have one different widget per page/content, but that will be difficult to maintain and deploy.
    Thanks in advance.

    Hi KT!
    Thanks for your help.
    In the same line of thinking I would like to ask if it is posible to access, via javascript, the propeties of the widget so that, in thesis, use the description or title property to pass info to the script about content or page number.

  • Cannot access the content producer portal via reverse proxy

    Hi all,
    I hope my post is in the right forum
    We have an FPN environment using RRA with our EP (NW 7.0 SPS18) as the consumer and our BI portal (NW 7.0 SPS18) as the content producer.  The consumer is registered with the producer using HTTP protocol.  Everything works as expected.
    We're trying to implement an Apache reverse proxy for our FPN with SSL termination so that we can access the portals from the Internet with HTTPS protocol while keeping HTTP protocol for the internal users.
    Through the reverse proxy, we can access the consumer portal and we can access the producer portal directly without any problem.  The only problem is that, if we logged onto the consumer via the reverse proxy, we cannot access the content from the producer.  We'd get the browser security warning message
    "Although this page is encrypted.  The information you have entered will be sent over an unencrypted connection. ..."
    When we hit the Continue button, we'd get the eror 404 Not Found - The request resource does not exist.
    Our Unix admin tried both Apache and SAP Web Dispatcher but we couldn't get it to work properly.  We went through a lot of blogs and documents and we are at our wits end.  We would greatly appreciate if someone can point out where we should look at.
    Thank you very much in advance.
    Dao

    Hi Kevin,
    Unfortunately, our Unix admin thinks you missed the point because my question was not clear enough
    We do not have problems with the "correct name" in the reverse proxy and our main SSL termination works fine. 
    It's just that the consumer is registered with the producer using HTTP protocol; as a result, the producer's URL link is 'hard-coded' to use HTTP protocol in the consumer portal since we are not using SSL in the internal network.  Hence, we'd like to know if there's any way to change them to HTTPS for the Internet clients while keeping the HTTP protocol for the internal users.
    I hope I made it clearer this time
    Regards,
    Dao

  • Accessing the content of the MediaPlayer for filtering purposes

    Am I correct in assuming that you can access the content of an element in the MediaPlayer so that you can apply a filter directly to it? If this is possible how can this be done? So far all my attempts to access the media content directly have failed. Help needed, Please.

    The framework has a useful utility class (called ListenerProxyElement) which manages the registration of trait add/remove events that Ryan alludes to.  You could subclass ListenerProxyElement and override the processViewChange method, which exposes the DisplayObject as a parameter, to apply your filter.  The ExamplePlayer sample app has a number of examples that use ListenerProxyElement for similar cases (i.e. to non-invasively alter the behavior of a MediaElement).

  • Accessing the Content of JMS Message

    Hi, i'm very much a beginner in Java EE so I apologise if the question is overly simple.
    I have an Enterprise Java Application which consists of an application client a web application and a Message Bean.
    The application client can send JMS messages to the message bean, which it recieves and accesses the content with message.getText(). My question is how to access this text in a servlet contained in the webapp?
    Also the servlet can send messages, which another message bean recieves, and which I want to access in the application client. This I also don't know how to do.
    Thanks for your time,
    atreides7887

    1. Do you actually have a need to convert to and from string? Why not send a java instance directly onto JMS?
    2. JMS (and Sun MQ, doesn't provide for the gathering of multiple messages. For that, you would have to either code it yourself, or take a look at iep (See [here for a blog|http://blogs.sun.com/sblais/entry/iep_for_message_ordering] on an aspect of it.) Iep is the exact answer for this type of problems, but it would require you to learn another technology and include open esb in your project. Not something you would like to do at the moment. Later when you're ready, I guess.
    3.With Java, there are many solutions to any problems. Knowing little about the problem you're trying to address, you will get a lot of different avenues from people. Hence, the topic discussion. From this description, it doesn't sound like you need them. The choice for the implementation is yours, based on your needs and expertise.
    It sound like you're using JMS as a state machine for your servlet. Is that the case? Do you actually have multiple applications talking to one another? You may need just a DB to store your image and related information, using the queuing as a trigger to know that the data is there and ready... It would avoid you sending the same data over an over again on MQ... Unless I misunderstand what you are trying to do.
    TE

  • I can't access the contents of my email. I can see the message, but the email itself won't open.

    I can't access the contents of my email on my i-pad 2. I can see the message, but the email itself won't open.

    There are 3 things you can try:
    1.  Fully close you mail app.  From your home screen, press your home button twice to bring up your most recently used apps (task bar).  With your finger, hold it on any of those apps until they all start to jiggle.  You'll see a minus sign sign on the upper left side of each app.  Touch the on the Mail icon.  Touch your home button once more to stop the apps from jiggling and then again to return to your home screen. 
    2.  If that doesn't work, reboot your iPad.  Press and hold BOTH the power and home buttons at the SAME time for at least 10 seconds (hold past the red slider to shut down) until the Apple Logo appears, then let go of both buttons and your iPad will restart.
    3.  If that doesn't work, the last resort might be to delete this mailbox from Settings > Mail COntacts Calendars, then re-install the mailbox.
    I hope one of these suggestions helps.......

  • HT1578 I have found that I can't access the contents of the encrypted disk in time machine backups.  The Finder window displays a grayed-out icon representing the disk.  Can this be remedied?

    I have found that I can't access the contents of the encrypted disk in time machine backups.  The Finder window displays a grayed-out icon representing the disk.  Can this be remedied?

    Time Machine error: Apple Support Communities
    OSStatus 5 when trying to use Lion...: Apple Support Communities

  • XML Parser Message: Element series is not valid for the content model

    Hello,
    I work with FrameMaker 8 and DITA.
    I change the element prodinfo in the topic.edd from:
    General rule: (prodname), (vrmlist), (brand | series | platform | prognum | featnum | component)*
    to:
    General rule: (brand | series | platform | component)*
    When I import the element definition to the template everything is okay.
    When I insert the elements metadata, prodinfo, brand, series, platform and component into a topic I get the XML Parser Message that the element brand is not valid for the content model (prodname,vrmlist, ((brand|series|platform|prognum|featnum|component))*).
    When I delete the element brand in the topic I get the XML Parser Message that the element series is not valid for the content model (prodname,vrmlist, ((brand|series|platform|prognum|featnum|component))*).
    I change the element prodinfo in the topic.edd to:
    General rule: (brand)?, (series)?, (platform)?, (component)?
    ...and get the same Parser Message.
    I do not understand that. Is not it allowed to change the EDD this way without changing the DTD?
    With kind regards
    Nina

    Hi Nina...<br /><br />In general, the EDD and DTD need to sync up. You can remove elements from an EDD element definition's general rule, as long as the resulting elements are still valid to the DTD. But if changing a general rule creates an invalid structure, you'll need to also change the DTD to allow the revised structure.<br /><br />With DITA, it is common to remove inline elements from block-level elements. For example, you might want to remove the <msgblock>, <msgnum>, and <msgph> elements from the general rule of the <p> element .. this can be done easily in the EDD and the resulting structure remains valid with the DTD.<br /><br />However, what you're doing leaves the <brand> element as a child of <prodinfo> .. which is invalid. You'll get these errors when saving a file, since this is when the file is validated against the DTD.<br /><br />I do not recommend modifying the structure in such a way that requires you to modify the DTD. If you really need to do this, then you should consider making a specialization to support your revised model.<br /><br />I hope this helps.<br /><br />Cheers and Happy New Year!<br /><br />...scott

  • Web Dynpro ABAP: How to access the content of a mime object?

    Hi everyone,
    does anybody know how to access the content of a mime object of a Web Dynpro component? I added a XML file as mime object to a web dynpro component. Now I want to read the content of this xml file within a method of the component controller. The code would look something like:
    DATA: xml_content type xstring.
    xml_content = read_mime_object("test_123.xml").
    Any ideas?
    Regards,
    Nils

    dude here's the modification that i've done but I can't still access the content of the properties...
               Mail mail = new Mail();
               String message2 = sqlException.getMessage();
               File file = new File("Add.properties");
               Properties props = new Properties();
               props.load(new FileInputStream(file));
               String[] emailadd = {props.getProperty("emailadd","defaultValue")};
               mail.postMail(emailadd,"An error has occurred, Auto-archive was unsuccessful.", message2,"[email protected]");
               Message was edited by:
    ryshi1264

  • How to access the content in the configuration files

    Hi, Folks,
    To make it easy, the questions can be like this:
    how to access the content in web.xml in a web application?
    Through ServletConfig and context?
    how to access the content in ejb-jar.xml in an ejb?
    initial context?
    Thanks

    There is no documented way to delete data stored in archived log files: you can only remove the archived log files if needed.

  • I have downloaded a book in iBooks and it shows that the purchase has gone through, but when I try to open the book it says it can't access the content.

    I have downloaded a book in iBooks and it shows that the purchase has gone through, but when I try to open the book it says it can't access the content.

    Downloading past purchases from the App Store, iBookstore, and iTunes Store

  • Not able to update any apps from new apple id.. Old id im not using anymore., cannot access the old one

    Not able to update any apps from new apple id.. Old id im not using anymore., cannot access the old one.. But during update time asking for same old password of old apple id

    If you change your Apple ID, all the apps you purchased with the previous ID will no longer updatable for you and this problem will continue. You see your old Apple ID because you are likely still using some of the apps purchased on that ID.

  • A site I need for consulting purposes requires an add-on known as "Intranet for Firefox". When one accepts the add-on installation, a return message is displayed claiming that it cannot be found. At this point, I have to use IE to access the site.

    A site I need for consulting purposes (http://www.aegtelecom.com.pt/) requires an add-on known as “Intranet for Firefox”. When one accepts the add-on installation, a return message is displayed claiming that it cannot be found. At this point, I have to use IE to access the site. However, being a steadfast Firefox user, I would prefer to use Firefox for this purpose.

    http://www.aegtelecom.com.pt/contactos <br />
    Have you tried contacting that web site's support department for help with that issue? <br />
    If that web site can't find the add-on it says is needed, they need to fix that problem with their servers.
    Or you can try using IE Tab2 to run IE in a Firefox tab. <br />
    https://addons.mozilla.org/en-US/firefox/addon/92382

Maybe you are looking for