How to search XML file for specific attributes ...

Hi, Im trying to design a XML driven billboard. Is there an easy way to seach attributes of all elements using DOM parser and return the element with attribute that matched search criteria?

Yes. Are you using jsdk1.4? If true then look at the XPathAPI.
I wrote a package for working with XML vocabularies. If you are interested on it, here is an example that uses amic-util.jar to find nodes with the id-user attribute:
XmlReader xr = new XmlReader("vocabulary.xml");
NodeSet ns = new XPathFinder(xr).findNodes("*[@id-user]");
while(ns.hasNextNode()) {
  XmlReader node = ns.nextNode();
}Send me an e-mail and I will send you back the amic-util.jar and the javadocs.

Similar Messages

  • How to generate xml-file for SAP Fiori (UI add-on) with Solution Manager 7.0.1?

    Hello Guru,
    could you please help with my issue with Fiori Installation.
    We want to install SAP Fiori Front-End (GW+UI) on the Sandbox system with SAP Netweaver 7.3.1. (SP14)
    Gateway component (SAP GW CORE 200 SP10) was installed without any problems.
    But I need to install UI-add-on (NW UI Extensions v1.0) and when I try to install it via SAINT, transaction said me that I need to generate xml-file for it (as in General notes for UI add-on mentioned).
    But I have Solution Manager 7.0.1 and in MOPZ for this version I do not have option  "install Add-on" as it written in Guide for ui add-on installation.
    Could you please help me with advice how to generate xml-file for UI add-on installation on SolMan v.7.0.1?
    If where is no way, but only to upgrade Solution Manager, maybe somebody could give me xml-file for your system (for NW 731) and I will change it to my needs, I will be very grateful!
    Thanks in advance for any help!!!
    Bets regards,
    Natalia.

    Hello Guru,
    could you please help with my issue with Fiori Installation.
    We want to install SAP Fiori Front-End (GW+UI) on the Sandbox system with SAP Netweaver 7.3.1. (SP14)
    Gateway component (SAP GW CORE 200 SP10) was installed without any problems.
    But I need to install UI-add-on (NW UI Extensions v1.0) and when I try to install it via SAINT, transaction said me that I need to generate xml-file for it (as in General notes for UI add-on mentioned).
    But I have Solution Manager 7.0.1 and in MOPZ for this version I do not have option  "install Add-on" as it written in Guide for ui add-on installation.
    Could you please help me with advice how to generate xml-file for UI add-on installation on SolMan v.7.0.1?
    If where is no way, but only to upgrade Solution Manager, maybe somebody could give me xml-file for your system (for NW 731) and I will change it to my needs, I will be very grateful!
    Thanks in advance for any help!!!
    Bets regards,
    Natalia.

  • Efficient searching in a large XML file for specific elements

    Hi
    How can I search in a large XML file for a specific element efficiently (fast and memory savvy?) I have a large (approximately 32MB with about 140,000 main elements) XML file and I have to search through it for specific elements. What stable and production-ready open source tools are available for such tasks? I think PDOM is a solution but I can't find any well-known and stable implementations on the web.
    Thanks in advance,
    Behrang Saeedzadeh.

    The problem with DOM parsers is that the whole document needs to be parsed!
    So with large documents this uses up a lot of memory.
    I suggest you look at sometthing like a pull parser (Piccolo or MPX1) which is a fast parser that is program driven and not event driven like SAX. This has the advantage of not needing to remember your state between events.
    I have used Piccolo to extract events from large xml based log files.
    Carl.

  • How to search xml file data based on the given keyword from html form

    hi,
    i'm new to XML. I have this problem regarding searching within a XML file.
    the
    idea is that my search will be based on the keyword entered
    in
    by the user from a HTML form. the keyword is then used to search all
    the
    question nodes and the choice nodes within a XML file. once the match
    is
    found, i will have to display the results.
    But i don't know how to do so - especially the part of searching xml file.
    Can
    anyone help me in this? Your help is much appreciated.
    Edited by: Moti_Lal.D on Apr 4, 2008 7:28 AM

    yeah.. what i was trying to do is
    i have one xml fine. then i have to read all the tag values say
    <book>
    <title>Java</title>
    <author>agarwal</author>
    <price>200</price>
    </book>
    <book>
    <title>Xml</title>
    <author>saxmann</author>
    <price>300</price>
    </book>
    i can read the tag values like this
    File file = new File("dom.xml");
    try {
    DocumentBuilder builder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
    Document doc = builder.parse(file);
    NodeList nodes = doc.getElementsByTagName"book");
    for (int i = 0; i < nodes.getLength(); i++) {
    Element element = (Element) nodes.item(i);
    NodeList title = element.getElementsByTagName("title");
    Element line = (Element) title.item(0);
    what i want is i may give any xml file
    like File file = new File("xxx.xml");
    (it may be one level/two level/3level tagged one)
    then the i should read all the tag values and store them in some array. Then when i enter some character from keyboard (say "a") then it has to show all the tag values starts with "a" and display them.
    i guess u understand my problem.

  • How to design Flat file for loading attribute dimension in a planning application

    Dear Gurus,
    I have a requirement to extract attribute dimensions from an essbase application and load it to another planning application. I have a dimension called Program and two attribute dimensions Sales Manager, Accounts manager associated with Program dimension in Essbase application. I will Extract these dimensions using Essbase outline extractor. After Extracting the attribute dimensions I have to load these dimensions to planning applications using outline load utility. Kindly guide me how to design the flat file for loading attribute dimensions in planning application.
    Thanks and Regards
    SC

    You could dig through the docs and try to figure out the file format manually, or you could do this the easy way.  Simply use the Outline Load Utility to export your attribute dimension from Planning.  The export file format is the same as the import file format.  You might have to manually add a couple of test members to your attribute dimension so that your export file has some content.  Then simply update the file you exported, and import it.
    (I am assuming you have already manually created the Attribute dimension in Planning, and that you simply need to add members to it.)
    Hope this helps,
    - Jake

  • How to load XML file for Custom Pod in 7.5?

    I'm developing a custom pod for our Connect 7.5 deployment, and I'm attempting to load an XML file that resides in the assets/ folder of my project. I run the pod in Flash Builder 4.5 to debug and it works just fine. Whenever I load the pod into our Connect 7.5 solution, it appears as if none of the events for the URLLoader are triggered.
    Is there something else I need to do? Please help!  Note - I have tried loading XML both from an actual URL and locally. Both work fine in the IDE just not when pod is in Connect.
    Thanks

    Did you follow the guidelines in the Connect 6 SDK documentation? This document was applicable from version 6 through 7.5.
    http://help.adobe.com/en_US/Connect/6.0/SDK/help.pdf
    Your SWF needs to be named index.swf to work, as I recall.

  • Search files for specific lines of data

    Hi all, I have a problem that I hope someone can help me with.
    I need to find a way to search for specific lines of data on a file.
    Here's the setup.... say for example I have 10 files, each filled with log files containing data like the date they were created and also certain information they were monitoring.
    From a Java applet, a user types in information that they want (for example, only lines that were created between 2002/04/04 and 2002/05/05 and only ones tagged with "Caution"). I need a way to grab all of those line from each of the files, without having to open each file, read each line and check for each search request. Instead, I want to simply grab all of the data at once, or at the very least, grab all of the data from the first file, then grab all of the data from the second file etc, without having to search each individual line. (the reason I'm hoping for a command like this is because there will eventually be thousands of files that need to be searched, and opening each one, and then search each line one by one would take too long.
    Sort of like a grep command in Linux. Does Java have a similar command?
    Any information or samples would be greatly appreciated!

    I don't know how much control you have over the files that you have to search.
    Searching XML files would be a lot easier because XPATH queries will work exactly like SQL... The only problem being if your files are not XML at all.
    If you have control over the format of these files you are trying to search, then try XML... else you might have to write a batch utility that runs every N seconds and converts data in these files to XML format files conforming to a specific format and then your applet could query the XML files.
    There will be a small concurrency issue there, though; As there will be at least some time consumed by the thread.

  • How to dpwnload one XML file for each report row

    Hi all,
    i have a report on the products table with about 1000 rows
    desc of table products
    product_id varchar (10)
    product_desc varchar2 (2000)
    I would like to download on the file system an xml file for each row of the report
    the nane of each xml file = <product_id>.xml
    thanks in advance
    km

    Hi,
    You would probably find it better to search on the PL/SQL forum as this is more their area than Apex.
    From what I can see in there (and there are a number of examples that would help you), you need to do something like:
    DECLARE
    vPATH VARCHAR2(50) := '/DEV';
    vFILENAME VARCHAR2(50);
    vFILE UTL_FILE.FILE_TYPE;
    BEGIN
    FOR C IN (SELECT PRODUCT_ID, PRODUCT_DESC FROM PRODUCTS)
    LOOP
      vFILENAME := C.PRODUCT_ID || '.xml';
      vFILE := UTL_FILE.FOPEN(vPATH, vFILENAME, 'W');
      UTL_FILE.PUT_LINE(vFILE, '<xdr>');
      UTL_FILE.PUT_LINE(vFILE, '<product_id>' || C.PRODUCT_ID || '</product_id>');
      UTL_FILE.PUT_LINE(vFILE, '<product_desc>' || C.PRODUCT_DESC || '</product_desc>');
      UTL_FILE.PUT_LINE(vFILE, '</xdr>');
      UTL_FILE.FCLOSE(vFILE);
    END LOOP;
    END;I haven't included exception handling etc and you should check on the PL/SQL forum to see if there are better examples!
    Andy

  • How to create an XML File for Gantt?

    Hi Everybody.
    I need a Gantt in Web Dynpro ABAP. I need it for the boss to do a Forecast for Vacation. I Hope this is understanding.
    Did Anyone know how can i create a XML File for the Gantt at runtime?
    Thanks
    MSi

    Hi Marcus,
    the following link is to the JNet/JGantt developer doco
    [JNet/JGantt Developer Documentation|http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/lw/uuid/f010ec31-9658-2910-3c83-c6e62904eceb]
    included in this is the:
    [Schema for XML|http://www.sdn.sap.com/irj/sdn/go/portal/prtroot/com.sap.km.cm.docs/lw/webdynpro/jnet_jgantt%20developer%20documentation/schema/xml-spy/jnet-schema.html]
    You can use this to build XML to represent a gantt like chart.
    I did this to build XML to represent employee avaliablity - although we fronted the gantt through WD Java not ABAP - the java applet called is the same (I believe).
    Don't underestimate the work required to tweek your data into a decent layout. It took me days.
    There may be tools/api to help generate the XML - I don't know of them - I'd look forward to seeing any other replies to this thread from people who have used/built any.  An example of a class that generates JNet XML - CL_SPI_UI_JNET - but this does not seem to be a Gantt display.
    Cheers,
    Chris

  • How to generate an XML file for an animation of IK armature

    Can someone please tell me how to generate an XML file for an animation of IK armature.
    I have a 5 keyframe/16 frame animation of a human character made up of a series of moveiclip symbols that is animated with an IK armature.  I need the XML information from the animation. 
    When I go to Commands > Export Motion XML I get the error message "There is more than one object on frame 1" and then nothing happens.
    Thank you,
    c

    I hope that's not the case.  I want to write to adobe about it.  I think it's a great feature and it functions really well even though it is not a very developed IK tool.  My biggest issue with it is ouput options and integration with motion tweens.
    I have seen a lot of examples of animators using it online, just no one talked about output.  I just feel it hasn't been developed.  It can generate a sprite sheet but only for a single pose frame of the animation, and not all the key frames or pose tweens.  I find that functionality quite odd, as if adobe just forgot about IK when added in sprite sheets, etc. and the reason it half works is just an accident.

  • How to keep XML file in memory for specified period ?

    How to keep XML file in memory for specified period or forever, I have 5 applications running on WebSphere I wants to use XML file for all the applications. I mean when one apllication is not using XML file still I wants to keep it in memory ...
    Thanx in advance ,

    Hello,you can create a DocumentManager class,
    here is my solution in the past...
    you can use static Hashtable save the xml's Document,if one application want get
    a appointed Document.first,you can find it from Hashtable,if can't find it ,you
    can create it and put into Hashtable,if the words fail to express the meaning,sorry,my english is limited
    package com.foresee.xfiles.util;
    import java.util.*;
    import org.w3c.dom.*;
    import org.apache.log4j.*;
    import com.foresee.xfiles.common.*;
    import com.foresee.xfiles.server.exception.*;
    import com.foresee.xfiles.util.*;
    * <p>Title: </p>
    * <p>Description: </p>
    * <p>Copyright: Copyright (c) 2002</p>
    * <p>Company: </p>
    * @author unascribed
    * @version 1.0
    public final class DocumentManager {
    private static Category m_log = Category.getInstance(DocumentManager.class.getName());
    static {
    PropertyConfigurator.configure(Configurator.getLCF());
    public DocumentManager() {
    //synchronized
    public static synchronized Document getTransitionDoc(String path) throws SchemaCheckOutException{
    Document m_TransitionDoc;
    m_TransitionDoc = (Document)TransitionDoc.get(path);
    if (m_TransitionDoc == null){
    XmlHelper m_xh = new XmlHelper();
    try{
    m_TransitionDoc = m_xh.getDocument(path);
    }catch (SchemaCheckOutException se){
    m_log.error("������������������������"+path+"����:"+se.getUserMsg());
    throw se;
    TransitionDoc.put(path,m_TransitionDoc);
    return m_TransitionDoc ;
    public static synchronized Document getLogicCheckDoc(String path) throws SchemaCheckOutException{
    Document m_LogicCheckDoc;
    m_LogicCheckDoc = (Document)LogicCheckDoc.get(path);
    if (m_LogicCheckDoc == null){
    XmlHelper m_xh = new XmlHelper();
    try{
    m_LogicCheckDoc = m_xh.getDocument(path);
    }catch (SchemaCheckOutException se){
    m_log.error("������������������������"+path+"����:"+se.getUserMsg());
    throw se;
    LogicCheckDoc.put(path,m_LogicCheckDoc);
    return m_LogicCheckDoc ;
    public static Hashtable TransitionDoc = new Hashtable();
    public static Hashtable LogicCheckDoc = new Hashtable();

  • Possible elements in the instanceconfig.xml file for presentation services

    g'day
    Has anyone here come across a list of all the possible elements that can be put in the configuration file for a presentation service, instanceconfig.xml ?<P>
    I have found next to nothing in the documentations, about what can be configured there.<P>
    What I am specifically after is: How can I change the default listening port for the Presentation Service? The default port is 9710 and I want to move to another port.<P>
    Also, how can I move the JavaHost from the default port 9810? I can change the file <i>OracleBI/web/javahost/config/config.xml</i> to reflect the change. Once the JavaHost has been restarted it starts up on the expected port, but the Presentation Service still tries to communicate over RPC to port 9810. How do I configure the presentation service to search for the JavaHost on a non-default port?<P>
    I have boiled it down to my original question: What are the possible values I can configure in the instanceconfig.xml file?<P>
    Any comments here would be great.<P>
    Cheers,<br>
    Borkur

    So, I had a little breakthrough here.
    I found in the OBIEE deployment guide, page 142:
    To change the Presentation Services listener port
    1 Open the instanceconfig.xml file for editing.
    2 Locate the <WebConfig> element.
    3 Within the <WebConfig> tags, create the element <RPC> and assign it the RPC Listener Port
    value for the BI Presentation Services instance, as shown in the following example.
    <WebConfig>
    <ServerInstance>
    <RPC>
    <Listener port="9715" />
    </RPC>
    </ServerInstance>
    </WebConfig>
    NOTE: In the preceding example, the RPC Listener port for the BI Presentation Services instance
    has been changed to port 9715 from the default of 9710.
    4 Save changes to the file.
    This almost works. The RPC element has been deprecated, as was reported in the sawserver.out.log:
    The configuration entry 'RPC/Listener' is deprecated. Please refer to the admin guide for more information.
    What I then did was to just remove the RPC elements and leaving the Listener element straight under there ServerInstance element. This seems to have solved the problem.
    I still have to figure out how to let the Presentation Service know that I have moved the JavaHost to antoher port ...
    Cheers,
    Borkur

  • HOw to update XML file residing in DAM by component JSP in run-time?

    i have made a component which reads xml file residing in DAM.
    Content Author can fill some values in dialog of this component, as soon as author provide the values,i have to update these values in XML file and component reloadsby reading the updated xml file.
    i am trying to achieve this by making object of XML file and giving it's path., but i ma unable to access the XML file.
    Can anyone help me out to how to update XML file by component JSP in run-time?

    Now the changed data must be exported back into the XML file, meaning that the content of certain elements must be updated. How can this be done with XSLT?
    XSLT approach:  check these online tutorial
    http://www.xml.com/pub/a/2000/08/02/xslt/index.html
    http://www.xml.com/pub/a/2000/06/07/transforming/index.html
    ABAP approach:
    for example you have the xml (original) in a string called say xml_out .
    data: l_xml  type ref to cl_xml_document ,
            node type ref to if_ixml_node  .
    create object l_xml.
    call method l_xml->parse_string
      exporting
        stream = xml_out.
    node = l_xml->find_node(
        name   = 'IDENTITY'
       ROOT   = ROOT
    l_xml->set_attribute(
        name    = 'Name'
        value   = 'Charles'
        node    = node
    (the above example reads the element IDENTITY and sets attribute name/value to the same)
    like wise you can add new elements starting from IDENTITY using various methods available in class CL_XML_DOCUMENT
    so how do I access the XML file in order to update it?
    you have already read this XML into a ABAP variable right?
    Sorry couldnt understand your whole process, why do you need to read local XML file?
    Raja

  • How to read xml file as shown below.

    Hello,
    I am using flash builder 4 and currently working on implementing AIR application.
    I need to read xml file data.
    Normal xml files are easy to read and i am much more aware of it.
    But can any one have idea how to read XML file which is given below.
    <node>
    <key>ID</key>
    <integer>1</integer>
    <key>Name</key>
    <string>Dhwani</string>
    <key>Postno</key>
    <integer>20</integer>
    <key>deskname</key>
    <string>flex</string>
    <key>empid</key>
    <integer>25</integer>
    <key>projectname</key>
    <string>abc</string>
    </node>
    Here i have xml file in form of key value pair. <key> node shows name of the key and after that <integer> or <string> node are the value for that specific key.
    if i select node.key then it shows me all the keys. and from that i cant make out what is the value for key ID.
    Is there any way to take first node and then second. i mean first i ll take value of key and store it into some arraycollection. and then value will be stored.
    Any help is appreciated.. Looking for positive reply.
    Thanks
    Dhwani

    There are different methods to access XML data which have pro's and cons. Let us know more about what you want to do and we can help you.

  • How to search to files based on the metadata of the category in CS

    Hi,
    Can any one tell me how to search the files in the content services based on the metadata of the Category,I know how to search based on the Category using
    public static void attributSearch(String searchString)
    throws FdkException, RemoteException, Exception
    // get the Manager instances
    SearchManager sem = s_WsCon.getSearchManager();
    CategoryManager cat = s_WsCon.getCategoryManager();
    CommonManager cm = s_WsCon.getCommonManager();
    FileManager fm = s_WsCon.getFileManager();
    Item folder = fm.resolvePath("/idc/workspaces/BoardMembersProject", null);
    AttributeRequest[] catAttr =
    WsUtility.newAttributeRequestArray("ProjectCategory");
    // create AttributeRequest to retrieve CATEGORIES attribute
    AttributeRequest[] catClassAttr = WsUtility.newAttributeRequestArray(
    Attributes.CATEGORIES, catAttr);
    // define search options
    NamedValue[] nv = WsUtility.newNamedValueArray(new Object[][] {            
    { Options.SEARCH_VERSION_HISTORY, Boolean.TRUE },
    { Options.RETURN_COUNT, new Integer(100)
    // get search expresiion
    SearchExpression seExp = new SearchExpression();
    // searchString ="ProjectCategory";
    Item[] item = cat.getRequiredCategories(folder.getId(),catClassAttr);
    seExp = new SearchExpression();
    NamedValue[] attributes = item[0].getRequestedAttributes();
    seExp.setOperator(FdkConstants.OPERATOR_HAS_CATEGORY);
    seExp.setRightOperand("["+item[0].getName()+"]");
    // search documents
    NamedValue[] result = sem.search(seExp, nv, null);
    // search result display
    for (int i = 0; i < result.length; i++)
    if (result.getName().equals(Options.SEARCH_RESULTS))
    Item[] resulItem = (Item[]) result[i].getValue();
    WsUtility.log("Kveni",resulItem);
    if (resulItem != null)
    for (int j = 0; j < resulItem.length; j++)
    WsUtility.log("File " +resulItem[j].getName());
    But how do one search Based on the attributes of the category??
    thanks
    kveni

    Download the PM accelerator kit appropriate to your environment, and check out the TestSearch2.java example.
    http://www.oracle.com/technology/products/cs/developer/contentservicesdev/contenservicesdevkit.html
    Essentially you need to lookup the internal names of your category attributes, as well as have the internal name of your category class.
    categoryClassName = ...; // e.g. AHC_XXX
    attribute1name = ....; // e.g. CUSTOM_MYBOOLATTR
    you then create a normal search expression such as
    String attribute1Operand = "[" + categoryClassName + FdkConstants.SEPARATOR + attribute1name + "]";
    SearchExpression expr1 = new SearchExpression();
    expr1.setOperator(FdkConstants.OPERATOR_EQUAL);
    expr1.setLeftOperand(attribute1Operand);
    expr1.setRightOperand(Boolean.TRUE);
    Matt.

Maybe you are looking for

  • PI message ID in mapping field

    Hi experts, We have a requirement of generating a Uique number in ECC....since in PI, we have message id for every incoimg message which is UNIQUE , we need to pass the same messsage ID as a filed value in PI and map to one of the ECC field ...is it

  • Error in ECATT

    Hi all, I am working on ECATT. While trying to record the transaction, I am getting a pop up stating that "SAP FRONTEND ERROR.  Erroneous Data received. Application may not work correctly". After this, I couldnt record the trancactions. Is it related

  • Itunes stops working right after launch

    As of yesterday, when i open itunes , a few seconds after opening it stops working and shuts off I cant do anything to fix I have tried uninstall and reinstall, restroe points, and previous versions, nothing has worked, please help

  • How can i take off itunes 11???

    How can I down grade from Itunes 11???? <Edited By Host>

  • Help Viewer Window - always in front?

    Is there a way to get the Help Viewer Window so that it is not always in front in OS 10.6.2?