Problem using JSTL XML tags.

My xml tag is giving problems. All other tags (core/sql and EL) are working fine. Even a very simple code like :
<%@ taglib prefix="x" uri="http://java.sun.com/jsp/jstl/xml" %>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<!-- parse an XML document -->
<x:parse var="simple">
<a>
<b>
<c>C </c>
</b>
<d>
<e> E </e>
</d>
</a>
</x:parse>
<!-- display using XPath expressions -->
<x:out select="$simple//e"/>
gives error as :
javax.servlet.ServletException: Cannot inherit from final class
     org.apache.jasper.runtime.PageContextImpl.doHandlePageException(PageContextImpl.java:867)
     org.apache.jasper.runtime.PageContextImpl.handlePageException(PageContextImpl.java:800)
     org.apache.jsp.jsp.xml.first_jsp._jspService(first_jsp.java:65)
     org.apache.jasper.runtime.HttpJspBase.service(HttpJspBase.java:133)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
     org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:311)
     org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:301)
     org.apache.jasper.servlet.JspServlet.service(JspServlet.java:248)
     javax.servlet.http.HttpServlet.service(HttpServlet.java:856)
Pls. help!

Works with no problems for me. (same exact code posted into a JSP)
Running on Tomcat 5, Java1.4
What server are you running, and version of java?
Is there anything else on the page? Are you extending a class somehow?
Do you have any extra libraries in the web-inf/lib directory that might be conflicting?

Similar Messages

  • Build XML Document in Servlet use JSTL xml tags in JSP

    Is it possible to build an XML document either org.w3c.dom.Document or preferably org.jdom.Document in a Servlet and pass it as a Bean or Bean property to a JSP and use it in the JSTL xml tags? If so how is it done? I don't want to write the document out to a file.
    Thanks
    Mark

    Both DOM and JDOM allow you to serialize XML to an output stream. Use the StringWriter as the output stream and when its finished you will have the XML in a String. Put the String in the Request scope and your JSP should be able to see it.

  • Unable to use JSTL fn tags in WL 8.1

    hi,
              I am trying to use JSTL functions tags in my struts app, and I am seeing this error...
              Error in using tag library uri='http://java.sun.com/jstl/functions' prefix='fn': Tag Library Descriptor contains no Tag descriptions
              probably occurred due to an error in /newgui/customerservice/AdditionalLines.jsp line 4:
              <%@ taglib uri = "http://java.sun.com/jstl/functions" prefix = "fn"%>
              I have the entry in web.xml as below...
              <taglib>
              <taglib-uri>http://java.sun.com/jstl/functions</taglib-uri>
              <taglib-location>/WEB-INF/tlds/fn.tld</taglib-location>
              </taglib>
              I also have the fn.tld in the tlds folder along with other core and sql tlds. core tlds are working (they are 1.0.4 version), but I am having trouble using fn tags.
              btw, I am running the struts web-app on WL 8.1 Sp4 (or sp3) not sure...
              Any help is greatly appreciated...
              thanks,
              Kiran :)

    Update: I just looked up the WL version and it's 8.1 sp3
              So, I guess, JSTL 1.1 (which includes jstl fn tags) is not supported by WL.... Someone correct me if I am wrong.
              Thanks,
              pal :)

  • Combing jstl/xml tags with jsf - can't pass parameter

    I'm using the jstl/xml tags to parse portions of an xml document. For some value of an attribute I want to render a search link, many of these links may be rendered on a page and I need to track which one has actually been selected using the id of the generating xml element.
    This is what I've tried, both using h:commandLink and a f:param and t:commandLink (tomahawk) and a t:updateActionListener.
    It doesn't seem to be possible to expose the resolved value of the xpath ="@id" in any way that either the tomahawk or core jsf tags can see.
    <x:when select="$control[@type='SEARCH']">
    <input type="text" id='<x:out select="@id"/>' disabled="true">
    <x:set var="selectedId" select="@id"/>
    <h:commandLink action="#{pack.search}" value="#{msg['actionPack.label.search']}" styleClass="linkNoUnderline">
    <f:param value="${selectedID}" name="selectedID"/>
    </h:commandLink>
    <%--<t:commandLink action="#{pack.search}" value="#{msg['actionPack.label.search']}" styleClass="linkNoUnderline">
    <t:updateActionListener property="#{pack.searchingId}" value="${searchId}"/>
    </t:commandLink>--%>
    </x:when>

    The JSF and JSTL tags don't really play well together.
    Particularly conditional and looping tags.
    My suggestion would be - if you're using JSF, don't use JSTL.
    You are right in that the JSF tags don't bother with the xpath expression.
    Would it be possible to shift the xml logic into an action/bean somewhere, and just present the jsp page with a list of relevant objects?
    If I understand you are trying to determine which link was clicked on a page? In the JSF action "pack.search"?
    What method of iterating are you using? an x:forEachLoop? A datatable?

  • Problems in creating xml tags using java

    i had analysed the xmlnode builder class but i am unable to learn what is the functions of that class.
    so please send me a sample coding to create the following output.
    i need this kind of output.
    <?xml version="1.0"?>
    <tree>
    <node id="acc" text="Accounts" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con1">
    <contents>
    <node id="1" text="Liabilites" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con1">
    <contents>
    <node id="5" text="Capital" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con1">
    <contents>
    <node id="L5" text="Gods A/c" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con1"/>
    </contents>
    </node>
    <node id="10" text="Current Liablities" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con1"/>
    <node id="11" text="Cash On Hand" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con1">
    <contents>
    <node id="L11" text="Cash" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con1"/>
    </contents>
    </node>
    <node id="12" text="Bank Balance" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con1">
    <contents>
    <node id="L12" text="ICICI" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con1"/>
    </contents>
    </node>
    </contents>
    </node>
    <node id="2" text="Asset" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con1">
    <contents>
    <node id="6" text="Fixed Asset" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con2"/>
    </contents>
    </node>
    <node id="3" text="Expenses" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con1">
    <contents>
    <node id="15" text="Direct Expenses" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con2">
    <contents>
    <node id="8" text="Purchase" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con2"/>
    </contents>
    </node>
    <node id="16" text="InDirect Expenses" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con2">
    <contaents>
    <node id="L16" text="Staff Welfare" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con2"/>
    </contaents>
    </node>
    </contents>
    </node>
    <node id="4" text="Income" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con1">
    <contents>
    <node id="13" text="Direct Income" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con2">
    <contents>
    <node id="7" text="Sales" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con2"/>
    </contents>
    </node>
    <node id="14" text="InDirect Income" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con2"/>
    </contents>
    </node>
    </contents>
    </node>
    <node id="inv" text="Inventory" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con1">
    <contents>
    <node id="1" text="Raw Material" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con1">
    <contents>
    <node id="I1" text="Pigments" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con1"/>
    </contents>
    </node>
    <node id="2" text="Intermediate" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con1"/>
    <node id="3" text="Work In Process" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con1"/>
    <node id="4" text="Finised Goods" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con1"/>
    <node id="5" text="Packing Materials" cImage="tree/images/book.gif" oImage="tree/images/bookopen.gif" contextid="con1"/>
    </contents>
    </node>
    </tree>

    Unless you are using some special tag library or something, SQL is not, as far as I've ever seen, going to handle while loops within the statements. You want to create the table, then you have to create the CREATE statement string
    String c = "CREATE TABLE [dbo].[tblNewTable] (";
    for(int x = 0; x < vFieldFruitVector.size(); x++) {
       c += vFieldFruitVector.get(x) + " char 50 COLLATE SQL_Latin1_General_CP1_CI_AS NOT NULL";
    c += ")";
    int res = stmt.executeUpdate(c);

  • Problem using JSTL

    Hi
    i am stupid in jstl . I want use JSTL . i am using tomcat 5.0 & jdk 1.3
    i kept jstl.jar and standard.jar in /WEB-INF/lib and using core tags in jsp but when i run jsp it show me error like .i have not written anything in web.xml
    what should i do? plzz tell me
    org.apache.jasper.JasperException: Unable to read TLD "META-INF/c.tld" from JAR file "file:/E:/Tomcat 5.0/webapps/JSTL/WEB-INF/lib/standard.jar": java.lang.IllegalStateException: zip file closed
         at org.apache.jasper.compiler.DefaultErrorHandler.jspError(DefaultErrorHandler.java:50)
         at org.apache.jasper.compiler.ErrorDispatcher.dispatch(ErrorDispatcher.java:411)
         at org.apache.jasper.compiler.ErrorDispatcher.jspError(ErrorDispatcher.java:183)
         at org.apache.jasper.compiler.TagLibraryInfoImpl.<init>(TagLibraryInfoImpl.java:181)
         at org.apache.jasper.compiler.Parser.parseTaglibDirective(Parser.java:418)
         at org.apache.jasper.compiler.Parser.parseDirective(Parser.java:483)
         at org.apache.jasper.compiler.Parser.parseElements(Parser.java:1539)
         at org.apache.jasper.compiler.Parser.parse(Parser.java:126)
         at org.apache.jasper.compiler.ParserController.doParse(ParserController.java:220)
         at org.apache.jasper.compiler.ParserController.parse(ParserController.java:101)
         at org.apache.jasper.compiler.Compiler.generateJava(Compiler.java:203)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:495)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:476)
         at org.apache.jasper.compiler.Compiler.compile(Compiler.java:464)
         at org.apache.jasper.JspCompilationContext.compile(JspCompilationContext.java:511)
         at org.apache.jasper.servlet.JspServletWrapper.service(JspServletWrapper.java:295)
         at org.apache.jasper.servlet.JspServlet.serviceJspFile(JspServlet.java:292)
         at org.apache.jasper.servlet.JspServlet.service(JspServlet.java:236)
         at javax.servlet.http.HttpServlet.service(HttpServlet.java:802)
    note The full stack trace of the root cause is available in the Apache Tomcat/5.0.30 logs.

    Maybe jdk 1.4 or higher versions would solve your problem. Googled around and read that this may be a bug in lower versions when reading unsigned jars.
    cheers,
    ram.

  • [JS CS3] Problem with iterating xml tags

    Hello,
    Below is a script that is supposed to find text in a document and then tag it with an xml tag. I have run into a problem, which if I solve in the way I know how, causes another problem.
    When I iterate in a positive direction--i++--the first instance of the text (in this example "abc") is correctly tagged. But the second instance the tag recedes by two characters, that is, tags the three characters prior to the "c." A third instance will recede two more characters, ad nauseam, if my Latin is correct.
    The solution is to iterate backwards, i.e., i--. But this causes another problem. If there is more than one story, then the xml structure reverses the order of the stories. The elements within a story are ordered correctly however.
    So why is this happening and how can I solve it?
    Thanks,
    Tom
    var myDoc = app.activeDocument;
    var findABC = theTextFinder(myDoc,"abc");
    xmlTagIt(myDoc,"abc",UIColors.RED,findABC);
    //*****functions*******
    function xmlTagIt(docRef, tagName,colorOfTag, arrToTag){
        var tagName, colorOfTag,  arrToTag;
        myDoc.xmlViewPreferences.showStructure = true;
        myDoc.xmlViewPreferences.showTaggedFrames =true;
        myDoc.xmlViewPreferences.showTagMarkers = true;
        myDoc.xmlViewPreferences.showTextSnippets =false;
        myDoc.xmlPreferences.defaultStoryTagColor = UIColors.WHITE;
        var rootElement = myDoc.xmlElements.item(0);
        if (myDoc.xmlTags.item(tagName) == null) {
            var tagRef = myDoc.xmlTags.add(tagName, colorOfTag);
      } else {//if tag already exists then stop the script. Avoid double tagging
           myDoc.xmlViewPreferences.showStructure = true;
           alert("You have already run this script.");
           exit();
       }//end else
        //for (var i = arrToTag.length-1; 0 <= i; i--){
        for (var i = 0; i <= arrToTag.length-1;  i++){
            var elementRef = rootElement.xmlElements.add (tagRef,arrToTag[i]);       
         }//end for i
    }//end function xmlTagIt
    function theTextFinder(docRef,textFindIt){//last argument is the string of text to find
        app.findTextPreferences = NothingEnum.NOTHING;
        app.changeTextPreferences = NothingEnum.NOTHING;
        app.findTextPreferences.findWhat = textFindIt;
        var arrTextFindIt = myDoc.findText();
        return arrTextFindIt;
    }//end theTextFinder

    Dave,
    Thanks for the reply.
    I'm not sure what you mean by "convert the references on the fly." You mean find a way to advance two characters forward and tag that? In the script I submitted here I am only searching for "abc," which of course I would not search or at all  in real life. The script uses grep to search for about twenty different typographical errors that typically appear and tags them all.
    Reiterating backwards seems, at first sight the way to go. But I haven't a clue as to how to reverse the order of the stories. I can get an array of stories, and array.reverse() them, but am not sure how to then make the script put this reversed order into the xml structure. Any hints?
    There, of course is bigger problem with the stories. If the document is written with one story created after another then the order of them is top to botom. But if say a text frame edited into the middle of all this, that story is still the last one in the xml structure. At least in one test, that was so. Maybe the way to solve this is to build an array of stories that have as one xml attribute the page it first appears on. Then order the array according to that attribute.
    Any advice you give will be appreciated.
    Thanks,
    Tom

  • Problem using jstl and displaytags

    Hi all,
    I am using display tags taglib for generation of table. One of the columns has to be shown with the hyperlink attached to it. In order to acheive this i am using jstl taglib together with displaytags
    <display:table name="reportList" id="row" requestURI="viewengagementstatus.do" style="width: 100%;">
    <display:column  title="Period"  sortable="true" style="text-align:  center;" >
    <a href="/jsps/reportsummary.do?eid=<c:out value="${row.eid}" />&reportId=<c:out value="${row.ReportID}" />&reportPeriod=<c:out value="${row.targetDate}"/> " target="_blank"><font size="1"><c:out value="${row.targetDate}"/></font></a>
    </display:column>I am using jstl1.1.2.jar for jstl.
    When i run this on Weblogic10 and windows OS i am able to view the results. On performing the view source on the IE window, i get the following:
    <td style="text-align:  center;">
                   <a href="/jsps/reportsummary.do?eid=78004&reportId=104093&reportPeriod=Nov-2008 " target="_blank"><font size="1">Nov-2008</font></a>
    </td>but when the same code is run on the Weblogic deployed on the Linux machine, i am not getting the links and the name:
    the view-source of the application deployed on the linux machine shows:
    td style="text-align:  center;">
                   <a href="/jsps/reportsummary.do?eid=&reportId=&reportPeriod=" target="_blank"><font size="1"></font></a>
    </td>Any Ideas why this is occuring?
    Any help would be appreciated

    You should be using the one or the other, not both. Since your actual code shows that you don't need the jstl/core_rt taglib (you're using the JSP EL ${ } in JSTL tags rather than scriptlets <%= %> ), just remove that taglib declaration and continue using the jstl/core taglib.
    You should also rather place both the JSTL and standard JAR in the classpath of the application server. In case of Tomcat, put it in its /lib directory. Then remove all unnecessary JSTL and Standard JAR and TLD files from your whole webapplication project and also remove any related entries from the web.xml of your webapplication project. To use JSTL you only need to put the JAR files in the classpath of the application server and define the taglib in your JSP. Nothing less and nothing more. If you're using JSTL 1.2 rather than JSTL 1.1, then you need to remove the standard.jar file too since it is already merged in the jstl-1.2.jar file.
    Oh, the web.xml should also be declared that way that the application server uses at least servlet 2.4.

  • Problem Using JSTL in JSPProviderChannel

    hi every one ..
    has any one used JSTL with JSPProviderChannel..
    plz tell me where to put all jar files and tld files and what changes are to be made in web.xml file ..
    thanks
    san

    Hi,
    I have done all the above ie.,
    Copied the jar files (jstl.jar, standard.jar) to <portal-install-dir>/SUNWps/web-apps/portal/<instance>/WEB-INF/lib
    also copied the same jar files to desktop/default/classes directory.
    copied the *.tld's to desktop/default/tld directory
    and in my jsp file changed the
    <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt"%>
    to
    <%@ taglib uri="/tld/fmt.tld" prefix="fmt"%>
    it gives me error :
    JSPProvider.processJSPFile(): jsp=content.jsp,
    com.sun.portal.providers.ProviderException: JSPProvider.processJSPFile(): jsp=content.jsp, com.sun.portal.providers.jsp.jasper3.jasper.compiler.CompileException: /etc/opt/SUNWps/desktop/default/SimpleUserInfo/content.jsp(6,0) Unable to open taglibrary /tld/fmt.tld : Unable to open the tag library descriptor: java.sun.com     at com.sun.portal.providers.jsp.JSPProvider.processJspFile(JSPProvider.java:712)
         at com.sun.portal.providers.jsp.JSPProvider.processJspFile(JSPProvider.java:674)
         at com.sun.portal.providers.jsp.JSPProvider.getContent(JSPProvider.java:473)
         at com.sun.portal.desktop.context.ReusableProviderCaller.run(ReusableProviderCaller.java:145)
    com.sun.portal.providers.jsp.jasper3.jasper.compiler.CompileException: /etc/opt/SUNWps/desktop/default/SimpleUserInfo/content.jsp(6,0) Unable to open taglibrary /tld/fmt.tld : Unable to open the tag library descriptor: java.sun.com     at com.sun.portal.providers.jsp.jasper3.jasper.compiler.JspParseEventListener.handleDirective(JspParseEventListener.java:742)
         at
    If I refer it in my jsp as
    <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt"%>
    I get the following exception
    JSPProvider.processJSPFile(): jsp=content.jsp,
    com.sun.portal.providers.ProviderException: JSPProvider.processJSPFile(): jsp=content.jsp, com.sun.portal.providers.jsp.jasper3.jasper.compiler.CompileException: /etc/opt/SUNWps/desktop/default/SimpleUserInfo/content.jsp(6,0) Unable to open taglibrary http://java.sun.com/jstl/fmt : Could not locate TLD http://java.sun.com/jstl/fmt     at com.sun.portal.providers.jsp.JSPProvider.processJspFile(JSPProvider.java:712)
         at com.sun.portal.providers.jsp.JSPProvider.processJspFile(JSPProvider.java:674)
         at com.sun.portal.providers.jsp.JSPProvider.getContent(JSPProvider.java:473)
         at com.sun.portal.desktop.context.ReusableProviderCaller.run(ReusableProviderCaller.java:145)
    com.sun.portal.providers.jsp.jasper3.jasper.compiler.CompileException: /etc/opt/SUNWps/desktop/default/SimpleUserInfo/content.jsp(6,0) Unable to open taglibrary http://java.sun.com/jstl/fmt : Could not locate TLD http://java.sun.com/jstl/fmt     at com.sun.portal.providers.jsp.jasper3.jasper.compiler.JspParseEventListener.handleDirective(JspParseEventListener.java:742)
    Please help on using JSTL with Portal 6.1
    Thanks

  • Facing problem while removing XML tags which has been generated from SAP

    Hi All,
    I am facing problem in MII, while i trying to remove 1st 2 XML tags of XML as generated from SAP.
    Here is XML which has been generated from SAP
    u201C<?xml version="1.0"; encoding="UTF-8"?>
    <ZCIFSCHEDULE>
    <SCHEDULE>
    <MESSAGE_TYPE/>
    <SITE>A300</SITE>
    <SHOP_ORDER>2012020856</SHOP_ORDER>
    <QTY_TO_BUILD>6.000<;/QTY_TO_BUILD>
    <DATE_TIME>08-FEB-2012 20:57:21 +05:30</DATE_TIME>
    <OPERATION>PRS</OPERATION>
    <ITEM>IN-CT00228</ITEM>
    <DPICS_CODE>1229</DPICS_CODE>
    <REVISION/>
    <CYC_TIME_CURING/>
    <FLAG_AGING/>
    <AGING_MIN/>
    <PRODUCTION_VERSION/>
    <CYC_TIME_OC/>
    <CYC_TIME/>
    </SCHEDULE>
    </ZCIFSCHEDULE>u201D
    From above i want to remove 1st 2 tags and last one tag i.e.  u201C<?xml version="1.0"; encoding="UTF-8"?> , <ZCIFSCHEDULE> and last tag ZCIFSCHEDULE>u201D
    Its urgent!
    Did anyone done regarding this issues. Thanks in advance.
    Kind Regards,
    Praveen Reddy

    Hi Praveen,
    Are you trying to make the xml into a string?  I think if you remove the first tag, it will either automagically reappear or it will throw and error as being poorly formed xml. 
    In general, you can remove the nodes by the use of indexes.  Since you are operating at the root level, I am not sure how well it will work, but if your xml is in a property, you can reference the specific nodes by something like this:  myXML.Output{/*[1]} which if you put it in a tracer will display the contents of the first node (or blank if there are child nodes).  The node index can be dynamically set, but start with the simple hard coded one.  I would also start at the lowest child level to verify that it is working properly (a tracer will display the contents specified by the index).  You can also google xml indices (or indexes) and it will point to some other useful xml operators.
    I suggest that you play around with it and also work with the Link Types (hint: removeXML).
    Regards,
    Mike

  • Problems using java.xml.xpath - How to get values from DTMNodeList?

    Sorry for the waffle in the subject title, but I was unsure what to call it. I hope this thread is in the correct forum.
    I'm having problems using xpath to parse some data from an XML file. I am able to create an expression which obtains the elements I wish to retreive, but I'm unsure on how to go about getting their values. So far I have..
    public int getTerms(int PMID)
              String uri = "http://www.ncbi.nlm.nih.gov/entrez/eutils/efetch.fcgi?db=pubmed&id="
                           + PMID + "&retmode=xml";
              // Create an XPath object with the XPathFactory class
              XPathFactory factory = XPathFactory.newInstance();
              XPath xPath = factory.newXPath();
              // Define an InputSource for the XML article
              InputSource inputSource = new InputSource(uri);
              // Create the expression
              String expression = "/PubmedArticleSet/PubmedArticle/MedlineCitation/MeshHeadingList/MeshHeading/DescriptorName";
              // Use this expression to obtain a NodeSet of all the MeSH Headings for the article
              try
                   DTMNodeList nodes = (DTMNodeList) xPath.evaluate(expression,
                         inputSource, XPathConstants.NODESET);
                   int length = nodes.getLength();
                   String[] terms = new String[length];
                   // Test mesh terms are being stored.
                    *for (int i=0; i<length; i++)*
    *                    System.out.println(i + ": " + nodes.item(i).getNodeValue());*
                                                    return nodes.getLength();
              catch (XPathExpressionException e2)
              { System.out.println("Article with PMID " + PMID + " has no associated MeSH terms");}
              // return a default
              return 0;
         } The part in bold is the problematic code. I wish to retreive the values of each of the nodes I have taken into my DTMNodeList using a for loop to iterate through each node, and use the getNodeValue() method from the Node class which should return a string. However, the values I retreive are NULL. In the test document I use, the elements do have values.
    Here is a snippet of the XML file I am reading in:
    <MeshHeadingList>
      <MeshHeading>
      <DescriptorName MajorTopicYN="N">Binding Sites</DescriptorName>
      </MeshHeading>
    - <MeshHeading>
      <DescriptorName MajorTopicYN="N">Chromatium</DescriptorName>
      <QualifierName MajorTopicYN="Y">enzymology</QualifierName>
      </MeshHeading>
    - <MeshHeading>
      <DescriptorName MajorTopicYN="Y">Cytochrome c Group</DescriptorName>
      </MeshHeading>
    - <MeshHeading>
      <DescriptorName MajorTopicYN="N">Electron Spin Resonance Spectroscopy</DescriptorName>
      </MeshHeading>
    - <MeshHeading>
      <DescriptorName MajorTopicYN="N">Flavins</DescriptorName>
      </MeshHeading>
    - <MeshHeading>
      <DescriptorName MajorTopicYN="N">Heme</DescriptorName>
      </MeshHeading>
    - <MeshHeading>
      <DescriptorName MajorTopicYN="N">Hydrogen-Ion Concentration</DescriptorName>
      </MeshHeading>
    - <MeshHeading>
      <DescriptorName MajorTopicYN="N">Iron</DescriptorName>
      <QualifierName MajorTopicYN="N">analysis</QualifierName>
      </MeshHeading>
    - <MeshHeading>
      <DescriptorName MajorTopicYN="N">Magnetics</DescriptorName>
      </MeshHeading>
    - <MeshHeading>
      <DescriptorName MajorTopicYN="N">Oxidation-Reduction</DescriptorName>
      </MeshHeading>
    - <MeshHeading>
      <DescriptorName MajorTopicYN="N">Protein Binding</DescriptorName>
      </MeshHeading>
    - <MeshHeading>
      <DescriptorName MajorTopicYN="N">Protein Conformation</DescriptorName>
      </MeshHeading>
    - <MeshHeading>
      <DescriptorName MajorTopicYN="N">Temperature</DescriptorName>
      </MeshHeading>
      </MeshHeadingList>Any help would be appreciated.. thanks :-)

    Answered my own question....
    The element value is actually the child of the node I am current at, so instead of doing:
    i + ": " + nodes.item(i).getNodeValue()); I should have really done:
    i + ": " + nodes.item(i).getChildNode().getNodeValue());

  • Problem using JSTL tag libraries with OC4J 9.0.3

    Hi
    I'm using the JSTL tag libraries with OC4J 9.0.3. I'm using JDeveloper10.1.2. I put the fmt.tld and c.tld in the WEB-INF directory and I'm adding the jstl.jar and standard.jar library to the EAR file. Both tlds have:
    <tlib-version>1.0</tlib-version>
    <jsp-version>1.2</jsp-version>
    And OC4J 9.0.3 is compatible with tlib version 1.0 and jsp version 1.2. When I run the web app I get:
    OracleJSP: oracle.jsp.parse.JspParseException: Line # 1, <%@ taglib uri="/WEB-INF/fmt.tld" prefix="fmt"%>
    Error: oracle.xml.parser.v2.XMLParseException ( /dataSource.jsp ):
    line #:1 column #:48 : FIXED type Attribute value not equal to the default value 'http://java.sun.com/xml/ns/j2ee'.
    line #:2 column #:18 : Attribute 'xmlns:xsi' used but not declared.
    line #:3 column #:19 : Attribute 'xmlns:acme' used but not declared.
    line #:4 column #:27 : Attribute 'xsi:schemaLocation' used but not declared.
    line #:7 column #:16 : Attribute 'version' used but not declared.
    line #:14 column #:15 : Invalid element 'tag-class' in content of 'tag', expected elements '[tagclass]'.
    line #:14 column #:15 : Element 'tag-class' used but not declared.
    line #:15 column #:18 : Invalid element 'body-content' in content of 'tag', expected elements '[tagclass]'.
    line #:15 column #:18 : Element 'body-content' used but not declared.
    line #:16 column #:15 : Invalid element 'attribute' in content of 'tag', expected elements '[tagclass]'.
    line #:18 column #:12 : Invalid element 'type' in content of 'attribute', expected elements '[required, rtexprvalue]'.
    line #:18 column #:12 : Element 'type' used but not declared.
    line #:22 column #:15 : Invalid element 'attribute' in content of 'tag', expected elements '[tagclass]'.
    line #:24 column #:12 : Invalid element 'type' in content of 'attribute', expected elements '[required, rtexprvalue]'.
    line #:24 column #:12 : Element 'type' used but not declared.
    line #:28 column #:15 : Invalid element 'attribute' in content of 'tag', expected elements '[tagclass]'.
    line #:30 column #:12 : Invalid element 'type' in content of 'attribute', expected elements '[required, rtexprvalue]'.
    line #:30 column #:12 : Element 'type' used but not declared.
    line #:34 column #:15 : Invalid element 'attribute' in content of 'tag', expected elements '[tagclass]'.
    line #:36 column #:12 : Invalid element 'type' in content of 'attribute', expected elements '[required, rtexprvalue]'.
    Any ideas?

    Hi
    Thanks for the reply.
    I tried it and I get the same error:
    OracleJSP: oracle.jsp.parse.JspParseException: Line # 1, <%@ taglib uri="http://java.sun.com/jstl/fmt" prefix="fmt"%>
    Error: oracle.xml.parser.v2.XMLParseException ( /dataSource.jsp ):
    line #:1 column #:48 : FIXED type Attribute value not equal to the default value 'http://java.sun.com/xml/ns/j2ee'.
    line #:2 column #:18 : Attribute 'xmlns:xsi' used but not declared.
    line #:3 column #:19 : Attribute 'xmlns:acme' used but not declared.
    line #:4 column #:27 : Attribute 'xsi:schemaLocation' used but not declared.
    line #:7 column #:16 : Attribute 'version' used but not declared.
    line #:14 column #:15 : Invalid element 'tag-class' in content of 'tag', expected elements '[tagclass]'.
    line #:14 column #:15 : Element 'tag-class' used but not declared.
    line #:15 column #:18 : Invalid element 'body-content' in content of 'tag', expected elements '[tagclass]'.
    line #:15 column #:18 : Element 'body-content' used but not declared.
    line #:16 column #:15 : Invalid element 'attribute' in content of 'tag', expected elements '[tagclass]'.
    line #:18 column #:12 : Invalid element 'type' in content of 'attribute', expected elements '[required, rtexprvalue]'.
    line #:18 column #:12 : Element 'type' used but not declared.
    line #:22 column #:15 : Invalid element 'attribute' in content of 'tag', expected elements '[tagclass]'.
    line #:24 column #:12 : Invalid element 'type' in content of 'attribute', expected elements '[required, rtexprvalue]'.
    line #:24 column #:12 : Element 'type' used but not declared.
    line #:28 column #:15 : Invalid element 'attribute' in content of 'tag', expected elements '[tagclass]'.
    line #:30 column #:12 : Invalid element 'type' in content of 'attribute', expected elements '[required, rtexprvalue]'.
    line #:30 column #:12 : Element 'type' used but not declared.
    line #:34 column #:15 : Invalid element 'attribute' in content of 'tag', expected elements '[tagclass]'.
    line #:36 column #:12 : Invalid element 'type' in content of 'attribute', expected elements '[required, rtexprvalue]'.

  • Problem using XSLT & HTML Tags

    Hi all,
    I'm newbie using XML and XSL and i'm facing a problem that i would need some help.
    I wrote a XML using servlet that use a XSL and transform it in a HTML output. So everything seems to work fine but when i try to use HTML tags inside my XSL it is not executed. it looks like below viewing by the browser IE6.0.
    - <html>
    - <body>
    <b>Sun Sep 14 12:27:09 BRT 2003</b>
    <i>Hello World</i>
    </body>
    </html>
    The fact is that i want my HTML tags to be executed by the XSl file and do not simple show the tags. Can someone help me? I would appreciate any help since i've been spending long time with that without any answer.
    Thanks and Regards
    Fabio

    following below the code that generate the XML. I still need help.
    I hope someone can help me in this issue
    The servlet that generate the XML.
    response.setContentType("text/xml");
    String Xml = "";
    Xml = Xml + "<?xml version=\"1.0\"?>";
    Xml = Xml + "<?xml-stylesheet href=\"/XslGravaCrit.xsl\" type=\"text/xsl\"?>";
    Xml = Xml + "<!-- Here is a sample XML file -->";
    Xml = Xml + "<page>";
    Xml = Xml + "<title>Test Page</title>";
    Xml = Xml + "<content>";
    Xml = Xml + "<paragraph>What you see is what you get!</paragraph>";
    Xml = Xml + "</content>";
    Xml = Xml + "</page>";
    try{
    TransformerFactory tFactory = TransformerFactory.newInstance();
    byte[] arr=Xml.getBytes();
    ByteArrayInputStream bytes=new ByteArrayInputStream(arr);
    Source xsl=new StreamSource("../XslGravaCrit.xsl");
    Templates template=tFactory.newTemplates(xsl);
    Transformer transformer = template.newTransformer();
    transformer.transform(new StreamSource(bytes), new StreamResult(response.getWriter()));
    }catch(Exception e){
    System.out.println("Excecao 100: " + e.getMessage() + e.getLocalizedMessage());
    The XSL XslGravaCrit.xsl
    <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
    xmlns:java="http://xml.apache.org/xslt/java" exclude-result-prefixes="java"
    version="1.0">
    <xsl:strip-space elements="*"/>
    <xsl:output method="html" indent="yes" version="4.0"/>
    <xsl:template match="page">
    <html>
    <body><b>
    <xsl:value-of select="java:java.util.Date.new()"/>
         </b>
    <xsl:for-each select="/page">
    <xsl:sort select="paragraph"/>
    <xsl:value-of select="paragraph"/>
    </xsl:for-each>
    <i>Hello World</i>
    </body>
    </html>
    </xsl:template>
    </xsl:stylesheet>

  • Problem in reading XML - tags in same line

    Hi All,
    I am using DOM to read XML , my problem is that.I can only read xml entries like folllowing- i.e when tags are in same line only... Please help.
    <src from-page="jsp/Home.jsp"><navigation-case><action>loginaction</action><from-outcome>true</from-outcome><to-page>jsp/WelcomePage.jsp</to-page></navigation-case><navigation-case><action>loginaction</action><from-outcome>false</from-outcome><to-page>jsp/Error.jsp</to-page></navigation-case>
    </src>
    I am not able to read following XML file-
    <src from-page="*">
    <navigation-case>
    <action>logoutaction</action>
    <from-outcome>true</from-outcome>
    <to-page>jsp/Home.jsp</to-page>
    </navigation-case>
    <navigation-case>
    <action>logoutction</action>
    <from-outcome>false</from-outcome>
    <to-page>jsp/Error.jsp</to-page>
    </navigation-case>
    </src>
    Thanks

    Thanks for your response.You are right I am not handling spaces anywhere. How to do that?
    Can you please help in doing this?
    I am posting my code also-
    parser.parse("C:/portal-config.xml");
    org.w3c.dom.Document doc = parser.getDocument();
    org.w3c.dom.NodeList srcList = doc.getElementsByTagName("src");
    for (int i = 0; i < srcList.getLength(); i++) {
    org.w3c.dom.Node sourceNode = srcList.item(i);
    if (sourceNode.getAttributes().getNamedItem("from-page").getNodeValue().equalsIgnoreCase(from)) {
    org.w3c.dom.NodeList navigationCaseList = sourceNode.getChildNodes();
    for (int j = 1; j < navigationCaseList.getLength(); j++) {
    org.w3c.dom.Node navigationCase = navigationCaseList.item(j);
    org.w3c.dom.NodeList childList = navigationCase.getChildNodes();
    System.out.println("node : " + navigationCase.getNodeName());
    System.out.println("list : " + childList.getLength());
    Node action = childList.item(0);
    int type = action.getNodeType();
    // case Node.ELEMENT_NODE :
    System.out.println("node : " + action.getNodeName()+ " "+ action.getNodeValue());
    org.w3c.dom.Node fromOutcome = action.getNextSibling();
    org.w3c.dom.Node toPage = fromOutcome.getNextSibling();
    System.out.println("fromOutcome : " + fromOutcome.getNodeName());
    System.out.println("toPage : " + toPage.getNodeName() + " " + toPage.getNodeType());
    if(action.getNodeType()==1 & fromOutcome.getNodeType()==1 & toPage.getNodeType()==1){
    String actionValue = action.getTextContent();
    String outValue = fromOutcome.getTextContent();
    System.out.println("actionValue : " + actionValue);
    System.out.println("outValue : " + outValue);
    if (actionValue.equalsIgnoreCase(action1) & outValue.equalsIgnoreCase(outcome)) {
    return toPage.getTextContent();
    Seeking your support
    Thanks

  • Problems using mathml XML Schema in XMLDB

    I have successfully loaded the hierarchy of XML Schema definition documents for the current 'mathml' by adjusting the relative paths in all include and import statements, and by forcing the load to overcome cyclic dependency issues.
    However when I try to create a table using the XMLTYPE or register another schema which is dependent on mathml I receive the following error:
    ERROR at line 1:
    ORA-31079: unable to resolve reference to group "Content-expr.class"
    ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 37
    ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 61
    ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 126
    ORA-06512: at line 14
    Having tried loading into both 9iR2 and 10GR2 databases and pasting the document containing the 'Content-expr.class' into the parent document (i.e. removing the include) I have come to the conclusion that there is a problem with the schema definition.
    However being new to XML I do not know what ths issue is as the file containing the definition (math.xsd) is included well before the references in the parent document.
    Here is the group definition corresponding to the offending reference:
    <xs:group name="Content-expr.class">
    <xs:choice>
    <xs:group ref="ContExpr.class"/>
    <xs:group ref="PresExpr.class"/>
    </xs:choice>
    </xs:group>
    I am also unable to trace which reference is causing the problem as there are several.
    Does anyone have any suggestions as to what could be causing this issue, or how I can obtain further diagnostics?
    Any help much appreciated.
    Robert Honeyman
    *********** New info ***************
    OK. I have tried further to register the schema, and have the following additional information.
    I determined that I thought my problem was cyclic dependencies being resolved ONLY by virtue of the parent file mathml2.xsd. I therefore pasted all the files together in include order so that this was no longer an issue. I then performed the following actions:
    1. I tried to register into Oracle 9iR2 database (9.2.0.4) and received the following error:
    ERROR at line 1:
    ORA-31151: Cyclic definition encountered for group: "Content-expr.class"
    ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 0
    ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 26
    ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 131
    ORA-06512: at line 14
    2. I then tried registering the schema into an Oracle 10G Release 2 database as well, and received the following error:
    ORA-31084: error while creating table "MEDLINE"."math729_TAB" for element
    "math"
    ORA-01792: maximum number of columns in a table or view is 1000
    ORA-02310: exceeded maximum number of allowable columns in table
    ORA-06512: at "XDB.DBMS_XMLSCHEMA_INT", line 37
    ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 61
    ORA-06512: at "XDB.DBMS_XMLSCHEMA", line 126
    ORA-06512: at line 14
    My conclusions are as follows:
    1. 9iR2 (the version I was using at least 9.2.0.4) can't handle cyclic dependencies at all, or at least not complex ones.
    2. Neither 9iR2 or 10gR2 can handle cyclic dependencies (or other dependent definitions managed purely by virtue of a parent file with multiple include statements)
    3. 10gR2 can handle cyclic dependencies when they are all defined in the same file or resolved by an explicit include regardless of complexity.
    4. 10gR2 cannot handle highly complex XML Schema definitions due its limit of 1000 columns per table.
    Does anyone have any comments on these conclusions?
    I don't even want to handle Mathml, just another schema definition that imports it. I may try to make my own adjustments.
    Message was edited by:
    rhoneyman
    null

    Thanks, I found the relevant sections in the XML DB 10GR2 documentation (chapter 3 I think). As far as I can tell my options are to either use one of the following:
    - top-down technique creating tables for sub elements in the schema definition
    - bottom-up technique collapsing some of the lower elements into CLOBs (I guess this is semi-structured storage)
    The problem with Mathml is that it seems quite complex, with only one global schema element and many nested elements, hence only one table is created by XMLDB and it logically follows that we run out of columns.
    To get it to work is likely to involve a fair amount of manual schema modification, which incurs a maintenance overhead for me.
    It would be good if Oracle could provide a way of simplifying this maintenance of complex schemas to get them to be registered. I guess this would be increasing the number of columns alllowed for a table or offering some other parametric option for DBMS_XMLSCHEMA.REGISTER_SCHEMA that allowed a threshold and either a top-down or bottom-up approach to be taken automatically.
    For the time being I am using a simplified schema that does not depend on Mathml for my storage needs.

Maybe you are looking for

  • I have a question about Actions in Adobe Pro XI

    When I run an Action in Adobe Pro XI, the document does not close and I also have to click on each and every document.  I thought Actions, like I recall Batch Processing, was supposed to automatically move to the next document in the list, and not le

  • Adapter Modules: Set parameter values dynamic?

    Hi everybody, is it possible to set parameter values in adapter modules dynamic? Thanks Regards Mario

  • The Library is erased automatically .. Help !

    Hi, first of all sorry if my english is worng, but i don't speak the language very well (: I have a problem with iTunes ( I have Windows Vista Home Premium ) Sometimes, when i run the program, i don't find the music in there, but the files of the lib

  • How do I load photos to my iPhone 4s from my PC?

    I am unable to load any photos from my PC back to my iPhone. Is there a way to do this?

  • Using UK ipad 2 in Europe

    I'm traveling from the UK to Greece, I need to take my ipad 2 with me. The power supply in Greece is 220 V AC at 50 Hz. On the charger which came with the ipad it has Input: 100 - 240v, 0.45A (0.45A), 50 - 60Hz , Ouput 5.1v The power supply in the UK