Contents of List,xml parsing

I have code which reads an XML document, here is my code which reads in a sentence:
List nodeList1 = org.jdom.xpath.XPath.selectNodes(jdomDocument, "/document//token/@string");
for(int i = 0; i<nodeList1.size(); i++) {
System.out.println(nodeList1.get(i));
}This gives output like, for example:
[Attribute: string="John"]
[Attribute: string="attended"]
[Attribute: string="the"]
[Attribute: string="meeting"]
[Attribute: string="in"]
[Attribute: string="Athens"]
[Attribute: string="."]
But how can I access the words in the original string, "John attended the meeting in Athens". without the [Attribute:..... ] stuff around it?
For example, how could I print just "John" to the screen?
I tried .getValue() method but that doesn't work, because it can only be applied to attributes. Thanks.

The method's name is getNodeValue() -- should also be applicable to AttributeNodes.

Similar Messages

  • Use of XML parser to read/parse xml stored in DB as CLOB

    Hello,
    I am new to XML technology. I have xml data stored in DB as
    CLOB. I need to parse this data to retrieve VALUE fro certain
    tags. I would greatly appreciate any help. Any examples that
    manipulate xml data stored in DB can be of extreme help.
    DesiDBA

    As you use Oracle 9.0.1. We suggest you use XMLType instead of
    CLOB to store your XML documents.
    You can use xmlType.extract() to get the elements within the
    XMLDocuments.
    Please refer to our Oracle9i XML Demo for examples.
    http://otn.oracle.com/tech/xml/xdk_sample/xdkdemo_faq.html
    For Instructions:
    http://ws5.olab.oracle.com/faqdemo/source/instruction.xsql?
    pagename=ins_xmltype
    Or you have to do the SQL query to get XML documents and parse
    each document and extract the content yourself using XML Parser
    for PL/SQL.
    Thanks.

  • I am getting following error! XML Parsing Error: undefined entity Location: chrome://weave/content/options.xul Line Number 6, Column 3: setting id="weave-account" type="string" title="&account.label;" / --^

    I am getting followong error
    XML Parsing Error: undefined entity
    Location: chrome://weave/content/options.xul
    Line Number 6, Column 3: <setting id="weave-account" type="string" title="&account.label;" />
    --^

    I had this problem - it appeared to be due to having Firefox 4 with the Firefox Sync installed as an add-on. Firefox 4 has sync included so there is no need to have it as an add-on. I went to the add-on manager and removed Firefox Sync and now appears to be working correctly.

  • Can't add a new account in FireFTP. Get XML Parsing Error: undefined entity Location: chrome://fireftp/content/accountManager.xul Line Number 216, Column 17:

    I'm having trouble adding an additional account to FireFTP. I keep getting a yellow box with this title:
    XML Parsing Error: undefined entity
    Location: chrome://fireftp/content/accountManager.xul
    Line Number 216, Column 17:
    <menu label="&charsetMenuMore1.label;" accesskey="&charsetMenuMore1.accesskey;" datasources="rdf:charset-menu" ref="NC:BrowserMore1CharsetMenuRoot">
    ----------------^
    Don't understand the problem, can anyone help please?

    Try updating FireFTP to the latest 2.0.20 version.
    ''An update for Firefox 32 compatibility.''
    https://addons.mozilla.org/en-US/firefox/addon/fireftp/

  • Firefox crashes continually. Now I'm getting this error and cannot open firefox at all: XML Parsing Error: not well-formed Location: chrome://browser/content/browser.xul Line Number 1068, Column 87:

    SInce the latest update Firefox has crashed continually for about two weeks now. Continually means at least 10 times a day. Now it does not open at all and I get this message when launching Firefox:
    XML Parsing Error: not well-formed Location: chrome://browser/content/browser.xul Line Number 1068, Column 87:

    SInce the latest update Firefox has crashed continually for about two weeks now. Continually means at least 10 times a day. Now it does not open at all and I get this message when launching Firefox:
    XML Parsing Error: not well-formed Location: chrome://browser/content/browser.xul Line Number 1068, Column 87:

  • XML Parser returning XML content

    This probably seems like overkill..
    Im building a JSP that reads in XML and parses it. I then need to filter for specific values in the XML, and return a chunk of the XML to the output stream.
    So far I've got..
          //set-up in and content-type
            FileInputStream file = new FileInputStream (getServletContext().getRealPath("/games_arcade/xml/game_marketing_content.xml"));
            //response.setContentType("text/xml");
            //parse the request
            Document doc = null ;
            try {
                   DocumentBuilderFactory docBuilderFact = DocumentBuilderFactory.newInstance();
                   DocumentBuilder docBuilder = docBuilderFact.newDocumentBuilder();
                   doc = docBuilder.parse(file);
                   out.println("Go on ya good thing!!!");
            } catch (ParserConfigurationException pcEx) {
                throw new ServletException("jaxp not configured!", pcEx);
            //get needed data from the xml
            NodeList games = doc.getElementsByTagName("game");
              out.println(output.toString());
              Now Im lost. All the requisites are there, imports etc, Im just stuck with filtering the NodeList.
    Or am I completely wrong with this approach?
    Any help greatly appreciated.
    thanks!
    Stephen

    Hi,
    thanks for the replyand suggestions. Have a bit of an issue with this method, this method (due to technical limitations) is completely JSP, using a standard iPlanet 6.1 classpath. I cant deploy WAR's (and cant use taglibs). Xpath/XSL would be ideal, but how do I write the output as XML?
    So are you suggesting
    <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
      <xsl:output method="html"/>
        <xsl:template match="/">
            <xsl:for-each select="games/game">
              <xsl:if test="@id = $GAMEID">
                   ... output the xml node using value-of's etc...
              </xsl:if>
            </xsl:for-each>
          </xsl:template>
        </xsl:stylesheet>Cheers Dr Clap!
    Stephen

  • XML Parser and Content-type/encoding problem

    I've write a little and simple XML parser and a simple "trasformer" that recive an XML file and an XSL one and return HTML, here is the code:
    public static String toHTML(Document doc, String xslSource){
            ByteArrayOutputStream testo = new ByteArrayOutputStream();
            try{
                DOMSource source = new DOMSource(doc);
                TransformerFactory tFactory = TransformerFactory.newInstance();
                System.out.println("----> " + xslSource);
                Transformer transformer = tFactory.newTransformer(new StreamSource(xslSource));
                transformer.setOutputProperty(OutputKeys.INDENT, "yes");
                transformer.setOutputProperty("{http://xml.apache.org/xslt}indent-amount", "2");
                transformer.setOutputProperty(OutputKeys.METHOD, "html");
             transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
             transformer.setOutputProperty(OutputKeys.ENCODING, "UTF-8");
                transformer.transform(source, new StreamResult(testo));
            }catch(Exception ioe){
                System.out.println("2 XMLTool.toHTML " + new java.util.Date());
                System.out.println(ioe);        
            return testo.toString();
        }the problem is that I would like to put the HTML code its return into a JEditorPane; now I'm trying with this code:
    JEditorPane jep1 = new JEditorPane();
    jep1.setContentType("text/html");
    jep1.setText(v);
    // 'v' is the string returned by the code posted up (the XML/XSL transformer)but I can't see anything in my JEditorPane.
    I think that the problem is this line of code that the transformer add automaticaly ad HTML code:
    <META http-equiv="Content-Type" content="text/html; charset=UTF-8">Infact if I try to delete this line from the code I can see what I want but is'n good delete a line of code without understend where is the problem.
    So, can anyone help me?

    good.
    when u set ur output properties to html , transformer
    searches for all entity references and converts accordingly.
    if u r using xalan these files will be used for conversion of
    Character entity references for markup-significant
    output_html.properties
    (this should be in templates package)
    and HTMLEntities.res(should be in serialize package)
    vasanth-ct

  • 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

  • XML Parsing Error: no element found Location: jar:file:///C:/Program%20Files/Mozilla%20Firefox/chrome/toolkit.jar!/content/global/netError.xhtml Line Number 1, Column 1:

    Accidentally clicked on "Allow for Safe Networks Only" and saved it. When launching Firefox, this error: XML Parsing Error: no element found
    Location: jar:file:///C:/Program%20Files/Mozilla%20Firefox/chrome/toolkit.jar!/content/global/netError.xhtml
    Line Number 1, Column 1:
    I have uninstalled and reinstalled, changed to a new profile, nothing works. I have looked at Options - Network - No Proxy
    Please help as I love Firefox

    Start Firefox in [[Safe Mode]] to check if one of the add-ons is causing the problem (switch to the DEFAULT theme: Tools > Add-ons > Themes).
    * Don't make any changes on the Safe mode start window.
    See:
    * [[Troubleshooting extensions and themes]]

  • I've just tried to open Auroara and am only getting a small window stating... XML Parsing Error: undefined entity Location: chrome://browser/content/browser.xu

    I've just tried to open Auroara and am only getting a small window stating...
    XML Parsing Error: undefined entity
    Location: chrome://browser/content/browser.xul
    Line Number 540, Column 9: <button default="true"

    Start Firefox in <u>[[Safe Mode|Safe Mode]]</u> to check if one of the extensions (Firefox/Tools > Add-ons > Extensions) or if hardware acceleration is causing the problem (switch to the DEFAULT theme: Firefox/Tools > Add-ons > Appearance).
    *Do not click the Reset button on the Safe mode start window or otherwise make changes.
    *https://support.mozilla.org/kb/Safe+Mode
    *https://support.mozilla.org/kb/Troubleshooting+extensions+and+themes

  • Error mesage is XML Parsing Error: no element found Location: chrome://speeddial/content/speeddial.xul Line Number 1, Column 1:

    XML Parsing Error: no element found
    Location: chrome://speeddial/content/speeddial.xul
    Line Number 1, Column 1:
    This is the error message that I am getting when I try to signon to the Internet Mozilla Firefox.
    Thank
    Elaine Davis

    Sounds like a problem with the Speed Dial extension.
    * http://speeddial.uworks.net/
    See:
    * [[Troubleshooting extensions and themes]]
    ----

  • XI XML Parser: tag content with "'", single apostrophe: invalid character

    Hi all,
    we import XML-documents with the file adapter in a sender channel. everything works well.
    But if one of the XML-tag contents contains a single apostrophe ( ' ), then the XML parser stops with an error "An invalid character was found inside an entity reference. ". The message can not be processed. If I test the message content in the mapping -> no error.
    When the single apostrophe is dereferenced by an additional single apostrophe the XML-File can be processed.
    Question: does anybody know how this can be handled because it is not very nice of SAP XI to send single apostrophes in outgoing messages but cannot handle it in incoming messages from other systems? special adapter settings?
    Thank you very much
    regards
    Hans

    check bhavesh reply
    Suppress Special Character
    also check
    https://www.sdn.sap.com/irj/sdn/weblogs?blog=/pub/wlg/9420 [original link is broken] [original link is broken] [original link is broken]
    Implementing a Java Mapping in SAP PI to remove Escape Sequences from a file

  • Does Oracle XML Parser support Content Validation

    Hi there,
    Could someone out there give me a hint on whether the Oracle XML Parser has the capability of handling Content Validation? If yes, what's the mechanism behind it?
    From my understanding of the Oracle XML Parser, even with the validating mode turned on, the parser only validates the XML data against the DTD (if any), which involves checking whether or not the attribute names and element tags are legal, whether nested elements belong to where they are, and so on. But I dont see any Content Validation. And my guess is that this feature, namely Content Validation, is simply not supported in the current version of the Oracle XML Parser. Am I right?
    Any suggestion would be greatly appreciated. Thanks.
    ---Denali
    null

    Hi there,
    Could someone out there give me a hint on whether the Oracle XML Parser has the capability of handling Content Validation? If yes, what's the mechanism behind it?
    From my understanding of the Oracle XML Parser, even with the validating mode turned on, the parser only validates the XML data against the DTD (if any), which involves checking whether or not the attribute names and element tags are legal, whether nested elements belong to where they are, and so on. But I dont see any Content Validation. And my guess is that this feature, namely Content Validation, is simply not supported in the current version of the Oracle XML Parser. Am I right?
    Any suggestion would be greatly appreciated. Thanks.
    ---Denali
    null

  • Since update message "XML Parsing Error: undefined entity Location: chrome://browser/content/browser.xul Line Number 238, Column 5:" Tried everything - help!

    Since an automatic update ran I get the message <br />
    "XML Parsing Error: undefined entity <br />
    Location:chrome://browser/content/browser.xul <br />
    Line Number 238, Column 5: <br />
    <broadcaster id="devtoolsMenuBroadcaster_ChromeDebugger"----^"<br />
    when I try to open Firefox. I have had to go back to using Internet Explorer - Tried everything suggested including deleting then reinstalling Firefox, but still cannot get Firefox to open - help!

    Hello,
    Certain Firefox problems can be solved by performing a ''Clean reinstall''. This means you remove Firefox program files and then reinstall Firefox. Please follow these steps:
    '''Note:''' You might want to print these steps or view them in another browser.
    #Download the latest Desktop version of Firefox from http://www.mozilla.org and save the setup file to your computer.
    #After the download finishes, close all Firefox windows (click Exit from the Firefox or File menu).
    #Delete the Firefox installation folder, which is located in one of these locations, by default (your profile folder with bookmarks etc. WILL NOT BE DELETED):
    #*'''Windows:'''
    #**C:\Program Files\Mozilla Firefox
    #**C:\Program Files (x86)\Mozilla Firefox
    #*'''Mac:''' Delete Firefox from the Applications folder.
    #*'''Linux:''' If you installed Firefox with the distro-based package manager, you should use the same way to uninstall it - see [[Installing Firefox on Linux]]. If you downloaded and installed the binary package from the [http://www.mozilla.org/firefox#desktop Firefox download page], simply remove the folder ''firefox'' in your home directory.
    #Now, go ahead and reinstall Firefox:
    ##Double-click the downloaded installation file and go through the steps of the installation wizard.
    ##Once the wizard is finished, choose to directly open Firefox after clicking the Finish button.
    Please report back to see if this helped you!
    Thank you.

  • XML Parsing Error: undefined entity Location: chrome://weave/content/options.xul Line Number 6, Column 3:

    Firefox version 4.0.1
    Firefox Sync Version 1.7
    I have this combination installed on two different machines (one is WinXP, the other Win7).
    When I goto the Addons screen to see which addons are installed and I click the "option" button for the Firefox Sync addon I get a popup window that gives me this error message.
    The full details are as follows:
    XML Parsing Error: undefined entity
    Location: chrome://weave/content/options.xul
    Line Number 6, Column 3:
    <setting id="weave-account" type="string" title="&account.label;" />
    --^

    You don't need the Firefox Sync 1.7 extension with Firefox 4, Sync is a built in feature. Uninstall that extension and that error message shouldn't appear.

Maybe you are looking for

  • SMS Text Features

    Will Apple come out with features for SMS Text such as copy and paste and options for us to be able to time stamp every outgoing and receiving text? Why does Apple not allow the user to have more choice in the settings on his/her phone?

  • Local domain, IIS Hosting and SMTP issues.

    I have a local domain on Windows server 2012 with dns, dhcp, iis and smtp. (Yes, I am aware of the dangers of these combinations) it is for learning purposes only and not my main pc.  My local domain is willow.run and I am hosting a website, the doma

  • Question about zone_status_t

    Hi, I've got a development machine running the following version of Solaris: $ uname -a SunOS ratbert 5.10 Generic_120012-14 i86pc i386 i86pc $ cat /etc/release Solaris 10 8/07 s10x_u4wos_12b X86 Copyright 2007 Sun Microsystems, Inc. All Rights Reser

  • How can I search photos in my library by definition (300dpi or 72dpi) ?

    Hi, I have several questions before buy Lightroom licence but I haven't find how to do with trial version. 1° How can I search photos in my library by definition (300 dpi or 72 dpi) ? 2° Is it possible to search photos by same chromatic scale (all ph

  • 404 with link to shopping cart index.cfm

    I have tried to reference the file several ways without success.  Please help me sort this out.  Thanks! <a href="/index.cfm/fuseaction/YourShoppingCart.additem/productid=1001">add to cart</a> <a href="./index.cfm/fuseaction/YourShoppingCart.additem/