Locating XML Nodes in a stream

How can I get the exact location of a Node within an XML document so i can apply some attributes i.e color for display purposes by streaming the document .
I have looked into javax.xml.transform.SourceLocator. But its Get methods are intended only as an approximation for the sake of error reporting; it is not intended to provide sufficient information to edit the character content of the original XML document.
Please help.

You'll have to parse the entire document to determine its contents. A DTD or schema is typically referenced in the XML document, outlining the heirarchy and dependencies between XML attributes and elements.
You may want to consider using DOM parsing rather than SAX parsing. With DOM parsing, you create a parse tree of the entire XML document. This parse tree is then held in memory, allowing you to access it when you need it. Once you have determined the root node of the XML document, then you can use the Node.getFirstChild() to "climb down" through the tree. Subsequently, you can use Node.getNextSibling() to get the "next branch" in the tree. You may want to read up on the following classes:
     org.w3c.dom.Document
     org.w3c.dom.Node
     org.w3c.dom.ElementHere is some code to get the root element from a URL or InputStream:
* Returns the "root" or base element contained in an input stream
* returned from the specified URL.
* @param xmlUrl
* @return Element the root element
private Element getRootElementFromURL(URL xmlUrl) {
     BufferedInputStream bufferedStream;
     Element rootElement;
     try {
          // get the input stream from the URL
          bufferedStream = new BufferedInputStream(xmlUrl.openConnection().getInputStream());                         rootElement = getRootElementFromInputStream(bufferedStream);               } catch (Exception e) {                    throw new AuthenticationException(e);               }               return rootElement;          }                    /**           * Returns the "root" or base element contained in an input stream.           * @param input           * @return Element the root element           * @throws AuthenticationException           */                    private Element getRootElementFromInputStream(InputStream input)                throws AuthenticationException {               Document document;                         try {                                        // get the XML document from the input stream                    DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();                    DocumentBuilder docBuilder = docFactory.newDocumentBuilder();                    document = docBuilder.parse(input);               } catch (Exception e) {                    throw new AuthenticationException("A problem occured while " +                               "processing the response from the authentication server.", e);               }               return document.getDocumentElement();          }
          rootElement = getRootElementFromInputStream(bufferedStream);
     } catch (Exception e) {
          e.printStackTrace();
     return rootElement;
* Returns the "root" or base element contained in an input stream.
* @param input
* @return Element the root element
private Element getRootElementFromInputStream(InputStream input) {
     Document document;
     try {
          // get the XML document from the input stream
          DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
          DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
          document = docBuilder.parse(input);
     } catch (Exception e) {
          e.printStackTrace();
     return document.getDocumentElement();

Similar Messages

  • Using XSLT to extract value of a XML node with namespace

    I have a XML source code here.
    <?xml version="1.0" encoding="utf-8" ?>
    <rss version="2.0" xmlns:job="http://www.pageuppeople.com">
      <channel>
        <title>SMH Jobs</title>
        <link>internalrecruitment.smhgroup.com.au/jobsrss.ashx?stp=di</link>
        <description>A listing of jobs available here</description>
        <item>
          <title>eCommerce Optimisation Advisor</title>
          <description>A new and exciting opportunity exists for an experienced eCommerce Advisor to join</description>
          <job:location PUReferenceID="3711">Sydney - Inner Suburbs & CBD</job:location>
        </item>
      </channel>
    </rss>
    I want to use XSLT to extract value of a XML node with namespace <job:location>, and the returned value should be string 'Sydney - Inner Suburbs & CBD'. I tried a few XSL code below, but failed with error or nothing was returned.
    <xsl:value-of select="job:location" disable-output-escaping="yes"/>
    <xsl:value-of select="job/location" disable-output-escaping="yes"/>
    <xsl:value-of select="job\location" disable-output-escaping="yes"/>
    <xsl:value-of select="location" disable-output-escaping="yes"/>
    This might be an easy question for you, but I would appreciate if anyone can help.

    Hi Suncorp IT Learner,
    We need to tell the XSLT that some elements are in another namespace. Copy the xmls declarations for the prefixes you need to use. Then use the xsl format as:
    <xsl: value-of select=”job:location/@PUReferenceID”/>
    In following issue, Chriztian has a good explanation:
    http://our.umbraco.org/forum/developers/xslt/33353-XSLT-reading-XML-attribute-value
    Thanks,
    Qiao Wei
    TechNet Community Support

  • Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B

    Hi,
    I have developed several SSIS packages with the last Beta of VS2005 / SQL Server CTP. After the public release I tried to uninstall the CTP-Versions to install the msdn finals but this time I got lost and was not able to satisfy the requirements of the final setup of VS2005. So I decided to install the whole pc again and after some hours I had a clean machine (XP with latest SQL Server 2005 Standard and VS2005 Professional).   Now I have tried to open my SSIS-Project but getting the following error:   Error loading ImpNetqNewsRss.dtsx: Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B "Schlüssel ist im angegebenen Status nicht gültig.". You may not be authorized to access this information. This error occurs when there is a cryptographic error. Verify that the correct key is available.
    After some “googleing” I found this thread: http://forums.microsoft.com/msdn/showpost.aspx?postid=22739&siteid=1   If I’m right the solution should be to use a Package Password, but I can’t figure out where I have to go enter/change a password. I even can’t remember I that ever used a password on my old installation for a dtsx-package??   Any help is welcome…   Regards, Dirk

      Let's Say your package name is MyPackage
      In Visual Studio  Go to Control Flow Tab.
      Righ Click on an empty area inside the window not clicking  "Data Flow Component" .  pop up menu click the the properties to get to the properties window of MyPackage package.
    Under the Security Area -> You will see 
            ProtectionLevel              -- Change that to EncryptSensitiveWithPassword
            PackagePassword          -- enter password->  temp
    This should do the trick however to be sure:
    Below you will connection managers:
    Database Connections (if more than one preform on all) 
      Double Click your connection to get the property pages. Click "ALL" under the Connection Link on Left Side. Scroll Down to Security Area.
      Provide the followings:
       Password  (for the sql userid being used)
       Persist Security Info  = True
    Save the Package and connect to SQL Integration Srvices in SQL Manager  (To Server e.g; DBServer (Integration Services) 
      Stored Packages -> MSDB -->  Right Click --> choose Import Package
      in the property dialog box 
                  Package Location :   File System 
                  Package Path  -- Choose the location of your dtsx file.  (MyPackage.dtsx)
      Leave everything default.
      Click OK.
      Dialog box will appear asking for the Package Password 
      Provide the password-> temp
      You have successfully imported the package called MyPackage.
      In order to create a job.   
      In the job Step->
           Type:  SQL Server Integration Services Package
           In the General Tab:
                     Package Source :  SSIS Package Store
                     Server : DBServer  (Where we stored our package above)
        Click the button for the package:  Choose your package  (MyPackage)
       Click OK :
        It will ask the package password again :  temp
                    Package has successfully been loaded to Job Step.  Now you can schedule and do a test run on the job.
      Thanks for the patience of reading for those who are expert.
      - Azhar

  • Counting of XML nodes based on a condition

    Hello,
    I have following XML with me:
    <?xml version="1.0" encoding="utf-8" ?>
    <Rowsets DateCreated="2010-11-30T11:12:10" EndDate="2010-06-05T16:52:23" StartDate="2010-06-05T16:52:23" Version="12.0.10 Build(18)">
         <Rowset>
              <Columns>
                   <Column Description="Material Number" MaxRange="1" MinRange="0" Name="MAT" SQLDataType="1" SourceColumn="MAT"/>
                   <Column Description="Plant" MaxRange="1" MinRange="0" Name="WER" SQLDataType="1" SourceColumn="WER"/>
                   <Column Description="Storage Location" MaxRange="1" MinRange="0" Name="LGO" SQLDataType="1" SourceColumn="LGO"/>
                   <Column Description="" MaxRange="1" MinRange="0" Name="TANK" SQLDataType="1" SourceColumn="TANK"/>
                   <Column Description="Batch Number" MaxRange="1" MinRange="0" Name="BATCH" SQLDataType="1" SourceColumn="BATCH"/>
                   <Column Description="Valuated Unrestricted-Use Stock" MaxRange="1" MinRange="0" Name="CLABS" SQLDataType="8" SourceColumn="CLABS"/>
                   <Column Description="Quality Stock" MaxRange="1" MinRange="0" Name="CINSM" SQLDataType="8" SourceColumn="CINSM"/>
              </Columns>
              <Row>
                   <MAT>111</MAT>
                   <WER>US</WER>
                   <LGO>T1</LGO>
                   <TANK>T100</TANK>
                   <BATCH>2020</BATCH>
                   <CLABS>0</CLABS>
                   <CINSM>19.000</CINSM>
              </Row>
              <Row>
                   <MAT>222</MAT>
                   <WER>US</WER>
                   <LGO>T1</LGO>
                   <TANK>T100</TANK>
                   <BATCH>1010</BATCH>
                   <CLABS>1000000.000</CLABS>
                   <CINSM>0</CINSM>
              </Row>
              <Row>
                   <MAT>333</MAT>
                   <WER>US</WER>
                   <LGO>T1</LGO>
                   <TANK>T100</TANK>
                   <BATCH>1010</BATCH>
                   <CLABS>1000000.000</CLABS>
                   <CINSM>0</CINSM>
              </Row>
              <Row>
                   <MAT>444</MAT>
                   <WER>US</WER>
                   <LGO>T1</LGO>
                   <TANK>T100</TANK>
                   <BATCH>1010</BATCH>
                   <CLABS>1000000.000</CLABS>
                   <CINSM>0</CINSM>
              </Row>
              <Row>
                   <MAT>555</MAT>
                   <WER>US</WER>
                   <LGO>T1</LGO>
                   <TANK>T100</TANK>
                   <BATCH>1010</BATCH>
                   <CLABS>1000000.000</CLABS>
                   <CINSM>0</CINSM>
              </Row>
              <Row>
                   <MAT>666</MAT>
                   <WER>US</WER>
                   <LGO>T1</LGO>
                   <TANK>T100</TANK>
                   <BATCH>1010</BATCH>
                   <CLABS>1000000.000</CLABS>
                   <CINSM>0</CINSM>
              </Row>
         </Rowset>
    </Rowsets>
    Now, I want my select statement to return following based on a count of XML node:
    select
    If count(/Rowsets/Rowset/Row[CLABS > 0]/BATCH) > 1 then 'Mixing'
    else if count(/Rowsets/Rowset/Row[MAT = "Parameter Value"]/MAT) = 0 then 'None'
    else 'Other'
    from Tablename TT where TANK = something and Plant = something
    How can I achive this using Oracle query? I can do it using SQL server but not getting the correct syntax for Oracle :(

    I got the answer on my own :)
    SELECT CASE WHEN count(RW."CountofBATCH") > 1 then 'Mixing'
    WHEN count(RW."CountofMAT") = 0 then 'None'
    ELSE 'Other'
    END
    FROM TABLENAME TT, XMLTable('/Rowsets/Rowset/Row' PASSING TT.XMLCOL
    COLUMNS
    "CountofBATCH" PATH '/Row[CLABS > 0]/BATCH',
    "CountofMAT" PATH '/Row[MAT = "[Parameter Value]"]/MAT'
    ) AS RW
    where
    some condition

  • How to binding incoming xml node list to the tree control as dataProvider

    Recently, I faced into one issue: I want to binding incoming xml node (it's not avaliable at start) list to the tree control as a dataProvider.
    Since the incoming xml node list is not avaliable at beginning but I needs to bind it to the tree, so I create one virtual one in the xml, and prepare to remove it before the tree is shown. (ready for the actual node adding). But It did not work.
    Please see the presudo-code here:
    1.  Model layer(CsModel.as)
    public class CsModel
            [Bindable]
            public var treeXML:XML=<nodes><car label="virtualOne" id="1">
                                   </car></nodes>;
            (Here, I want to build binding relationship on the <car/> node,
             one 'virtual/stub' node is set here with lable="virtualOne".
             But this node will be deleted after IdTree
             control is created completely.)      
            [Bindable]
            public var treeData:XMLList =new XMLListCollection(treeXML.car);
    2. view layer(treePage.mxml)
            private var _model:CsModel = new CsModel();
            private function addNode():void
                    var newNode:XML=<car/>;
                    newNode.@label="newOne";
                    newNode.@id=1;
                    _model.treeXML.appendChild(newNode);
                             private function cleanData():void
                                     delete _model.treeXML.car;
            <mx:VBox height="100%" width="100%">
            <mx:Button label="AddNode" click="addNode()" />
            <mx:Tree id="IdTree"  labelField="@label"
              creationComplete="cleanData()"
              dataProvider="{_model}"/>
        </mx:VBox>
    3. Top view layer (App.Mxml)
    <mx:application>
        <treePage />
    </mx:application>
    For method: cleanData(),It's expected that when the treePage is shown, we first delete the virutalOne to provide one 'clear' tree since we don't want show virtualOne to the user. The virutalOne node just for building the relationship between treeData and treeXML at beginning. But the side effect of this method, I found, is that the relationship between treeXML and treeData was cut off. And this leads to that when I added new node (by click the 'addNode' button) to the xmlXML, the xmlData was not affected at all !
    So Is there any other way to solve this issue or bind the incoming xml node list to the xmlListCollection which will be used as Tree control's dataProvider ?

    If u want to display the name : value then u can do like this
    <xsl:eval>this.selectSingleNode("name").nodeName</xsl:eval> : <xsl:value-of select="name" />

  • SQL Server Agent Failed to decrypt protected XML node

    I'm getting the below error when trying to run sql server agent to run an SSIS package. I've updated folder security to allow sql server agent access, but cannot get the package to execute within SQL Management Studio. The package runs find in SSIS. 
    11.0.2100.60 for 64-bit  Copyright (C) Microsoft Corporation. All rights reserved.    Started:  12:12:00 PM  Error: 2014-11-30 12:12:02.65     Code: 0xC0016016     Source: LoadStgProspects      Description:
    Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B "Key not valid for use in specified state.". You may not be authorized to access this information. This error occurs when there is a cryptographic error. Verify that
    the correct key is available.  End Error  Error: 2014-11-30 12:12:03.88     Code: 0xC0016016     Source: LoadStgProspects      Description: Failed to decrypt protected XML node "DTS:Password" with error
    0x8009000B "Key not valid for use in specified state.". You may not be authorized to access this information. This error occurs when there is a cryptographic error. Verify that the correct key is available.  End Error  Error: 2014-11-30
    12:12:04.74     Code: 0xC0209303     Source: LoadStgProspects Connection manager "Excel Connection Manager"     Description: The requested OLE DB provider Microsoft.Jet.OLEDB.4.0 is not registered. If the 64-bit driver
    is not installed<c/> run the package in 32-bit mode. Error code: 0x00000000.  An OLE DB record is available.  Source: "Microsoft OLE DB Service Components"  Hresult: 0x80040154  Description: "Class not registered".
     End Error  Error: 2014-11-30 12:12:04.74     Code: 0xC020801C     Source: Load prospect files Prospect xls [231]     Description: SSIS Error Code DTS_E_CANNOTACQUIRECONNECTIONFROMCONNECTIONMANAGER.  The AcquireConnection
    method call to the connection manager "Excel Connection Manager" failed with error code 0xC0209303.  There may be error messages posted before this with more information on why the AcquireConnection method call failed.  End Error  Error:
    2014-11-30 12:12:04.74     Code: 0xC0047017     Source: Load prospect files SSIS.Pipeline     Description: Prospect xls failed validation and returned error code 0xC020801C.  End Error  Error: 2014-11-30 12:12:04.74
        Code: 0xC004700C     Source: Load prospect files SSIS.Pipeline     Description: One or more component failed validation.  End Error  Error: 2014-11-30 12:12:04.74     Code: 0xC0024107     Source:
    Load prospect files      Description: There were errors during task validation.  End Error  Error: 2014-11-30 12:12:04.74     Code: 0xC00220DE     Source: LoadStgProspects      Description: Error
    0xC0012050 while loading package file "C:\Users\Jim\Documents\Visual Studio 2010\Projects\SSISTraining\SSISTraining\LoadStgProspects.dtsx". Package failed validation from the ExecutePackage task. The package cannot run.  .  End Error  DTExec:
    The package execution returned DTSER_FAILURE (1).  Started:  12:12:00 PM  Finished: 12:12:04 PM  Elapsed:  4.337 seconds.  The package execution failed.  The step failed.,00:00:04,0,0,,,,0

    Hi selfdestruct80,
    According to your description, you created SSIS package and it works fine. But you got the error message when the SSIS package was called from a SQL Server Agent job.
    According to my knowledge, the package may not run in the following scenarios:
    The current user cannot decrypt secrets from the package.
    A SQL Server connection that uses integrated security fails because the current user does not have the required permissions.
    File access fails because the current user does not have the required permissions to write to the file share that the connection manager accesses.
    A registry-based SSIS package configuration uses the HKEY_CURRENT_USER registry keys. The HKEY_CURRENT_USER registry keys are user-specific.
    A task or a connection manager requires that the current user account has correct permissions.
    According to the error message, the SSIS Package ProtectionLevel property to EncryptSensitiveWithPassword as ArthurZ mentioned. To solve the problem, you need to go to Command Line tab, manually specify the paassword in SQL Agent Job with the command like below:
    /FILE "\"C:\Users\xxxx\Documents\SQL Server Management Studio\SSIS\Package.dtsx\"" /DECRYPT somepassword /CHECKPOINTING OFF /REPORTING E
    If you have any more questions, please feel free to ask.
    Thanks,
    Wendy Fu
    Wendy Fu
    TechNet Community Support

  • Convertion of String to XML node using Xquery transformation in OSB

    How to convert string to XML node elementusing a built in function using Xquery transformation in OSB?

    check this out - http://www.javamonamour.org/2011/06/fn-beainlinedxml.html
    if in SOA (BPEL & Mediator) you can use oraext:parseXML.
    you should thoroughly analyse where to implement your requirement as some good practices advise to implement more complex logic in SOA and leave OSB to only connect to the services' endpoints.
    Hope this helps,
    A.

  • Getting Error 'Root XML Node nqw not found in island!'

    I have upgraded my setup from OBIEE 11.1.1.5.0 to 11.1.1.5.1 and then uploaded a catalog created in older version, 11g itself.
    I'm able to run the dashboards and see all reports. They run absolutely fine, show all correct data.
    However if I try to edit report or try to open them in Answers module .... from anywhere (Catalog Link/ Edit option below reports in Dashboard) it gives me this error.
    " Root XML Node nqw not found in island! "
    It's strange. I tried following:
    1. doing a Upgrade of catalog by setting up parameter in instanceconfig.xml file
    <Catalog>
    <UpgradeAndExit>true</UpgradeAndExit>
    </Catalog>
    and then reverting back to false.
    2. Also tried the GUID upgarde by setting parameters in instanceconfig.xml file and NQSConfig.ini file
    none helped.
    Any help?

    Hi Naresh,
    I hope you have resolved the issue by this time.
    In my case, it was related to an invalid filter on the report.
    I have removed the filter by updating the report .xml file from Catalog Manager.
    Hope this helps other with similar issue.
    Thanks,
    Ravi

  • How to create xml nodes based on a value

    Dear friends,
    I've a question about graphical mapping in SAP PI...
    How can I create XML nodes on the target side based on a value in a XML field on the source side.
    For example:
    This XML field on the source:
    <NO_OF_LINES>4</NO_OF_LINES>
    Must result on 4 Lines on the Target:
    <LINE></LINES>
    <LINE></LINES>
    <LINE></LINES>
    <LINE></LINES>
    So it's actually the opposite of the Count function...
    I appreciate your help,
    Thank you in Advance,
    Kind regards,
    John

    Hi ,
    Try this
    NO_OF_LINES---> count---> UDF---> LINE
    example :
    UDF Code :
    for (int i=0;i<var1[0];i++)
    result.addValue("");

  • Xml in JTree: how to not collpase JTree node, when renaming XML Node.

    Hi.
    I'm writing some kind of XML editor. I want to view my XML document in JTree and make user able to edit contents of XML. I made my own TreeModel for JTree, which straight accesses XML DOM, produced by Xerces. Using DOM Events, I made good-looking JTree updates without collapsing JTree on inserting or removing XML nodes.
    But there is a problem. I need to produce to user some method of renaming nodes. As I know, there is no way to rename node in w3c DOM. So I create new one with new name and copy all children and attributes to it. But in this way I got a new object of XML Node instead of renamed one. And I need to initiate rebuilding (treeStructureChanged event) of JTree structure. Renamed node collapses. If I use treeNodesChanged event (no rebuilding, just changes string view of JTree node), then when I try to operate with renamed node again, exception will be throwed.
    Is there some way to rename nodes in my program without collpasing JTree?
    I'am new to Java. Maybe there is a method in Xerces DOM implementation to rename nodes without recreating?
    Thanks in advance.

    I assume that "rename" means to change the element name? Anyway your question seems to be "When I add a node to a JTree, how do I make sure it is expanded?" This is completely concerned with Swing, so it might have been better to post it in the Swing forum, but if it were me I would do this:
    1. Copy the XML document into a JTree.
    2. Allow the user to edit the document. Don't attempt to keep an XML document or DOM synchronized with the contents of the JTree.
    3. On request of the user, copy the JTree back to a new XML document.
    This way you can "rename" things to the user's heart's content without having the problem you described.

  • How to set the value in the xml node.

    Hi
    I am having the application PDF which can be submitted by user using the button. while submitting 
    i am using below code to set the value in the xml node.
       xfa.data.assignnode("employee.id","123",0):
    So its generating the xml like below.
    <employee>.
    <id>123</id>.
    </name>
    </employee>
    Now i need to generate the xml like  below.
    <employee id= "123" >
      </Name>
    </employee>
    So how to set/create the id node like above?
    Advance Thanks.
    Regards,
    Dhiyane

    Hi Dhiyane,
    You will have to set the contains property if the id node to "metaData", that is;
    xfa.data.assignNode("employee.id","123",0);
    xfa.data.employee.id.contains = "metaData";
    Very clumsy if you have a number of them, in which case you might want to look at using E4X.
    Good luck
    Bruce

  • Map several records to different elements in the same xml node

    Hi,
    I am trying to map data from relational tables to elements as per my xml schema. One of my tables has several records that I need to map to different elements in the same xml node.
    For example:
    Customer_Id | Param_Id |Param_Name
    212 | 1 |State
    212 | 2 |Country
    212 | 3 |ZipCode
    I can not change the structure of this existing table and need to work with it.
    How do I map the different params for a specific customer to my Customer node in the schema?
    One option is to join on the parameters table several times, but there ought to be a better way!
    PLEASE HELP!!!
    Thanks,

    First I question the design that contains/allows 600 attributes on an element. They sound like they really should be elements in the XML.
    Regardless, the following (NOT TESTED) should work for you (assuming you want to write one SQL with 600 columns)
    CREATE OR REPLACE VIEW APPLICATION_XML
    OF XMLTYPE
    Element "LOAN_APPLICATION"
    with object ID
    substr(extractValue(object_value,'/LOAN_APPLICATION/APPLICATION_DATA/@CallID'),1,5)
    AS
    WITH parm_tb AS
    SELECT MAX(DECODE(prv_valu, 1, prv_value)) BusinessType,
           MAX(DECODE(param_id, 2, prv_value)) Product,
           MAX(DECODE(param_id, 3, prv_value)) SomethingElse
      FROM parameter_details
    WHERE prv_pmh_header_id = 1
    SELECT xmlElement
       ("APPLICATION_DATA",
         xmlAttributes
          p.prv_detail_id as "CallID",
          p.PRV_PRM_PARAM_ID as "RandomID",
          p.prv_value as AppInitDate
         xmlElement
         ("PRODUCER_DATA",
           xmlAttributes
            parm_tb.BusinessType as "BusinessType" ,
            parm_tb.Product as "Product"
      FROM parameters_table p
    WHERE p.PRV_PMH_HEADER_ID = 1

  • How to get Total Number of XML Nodes?

    Hello All,
    I have a Flash program I'm doing in Actionscript 3, using CS6.
    I'm using the XMLSocket Class to read-in XML Data. I will write some sample XML Data that is being sent to the Flash
    program below...
    I know with this line here (below) I can access the 4th "element or node" of that XML Data.
         Accessing XML Nodes/Elements:
    // *I created an XML Variable called xml, and "e.data" contains ALL the XML Data
    var xml:XML = XML(e.data);
    // Accessing the 4th element of the data:
    xml.MESSAGE[3].@VAR;          --->     "loggedOutUsers"
    xml.MESSAGE[3].@TEXT;         --->     "15"
         SAMPLE XML DATA:
         <FRAME>
    0               <MESSAGE VAR="screen2Display" TEXT="FRAME_1"/>
    1               <MESSAGE VAR="numUsers" TEXT="27"/>
    2               <MESSAGE VAR="loggedInUsers" TEXT="12"/>
    3               <MESSAGE VAR="loggedOutUsers" TEXT="15"/>
    4               <MESSAGE VAR="admins" TEXT="2"/>
         </FRAME>
    I'm new to Flash and Actionscript but I'm very familiar with other languages and how arrays work and such, and I know for
    example, in a Shell Script to get the total number of elements in an array called "myArray" I would write something like
    this --> ${#myArray[@]}. And since processing the XML Data looks an awful lot like an array I figured there was maybe
    some way of accessing the total number of "elements/nodes" in the XML Data...?
    Any thoughts would be much appreciated!
    Thanks in Advance,
    Matt

    Hey vamsibatu, thanks again for the quick reply!
    Ohhh, ok I gotcha. That makes more sense.
    So I just tried this loop below and I guess I could use this and just keep assigning an int variable to the output so
    when it finishes I will be left with a variable containing the total number of elements:
    for (var x:int in xml.MESSAGE)
         trace("x == " + x);
    *Which OUTPUTS the Following:
    x == 0
    x == 1
    x == 2
    x == 3
    x == 4
    So I guess I could do something like this and when the loop completes I will be left with the total number of elements/nodes...
    var myTotal:int;
    for (var x:int in xml.MESSAGE)
        myTotal = x;
    // add '1' to myTotal since the XML Data is zero-based:
    myTotal += 1;
    trace("myTotal == " + myTotal);
    *Which Prints:
    "myTotal == 5"
    Thanks again for you suggestions, much appreciated!
    I think that should be good enough for what I needed. Thanks...
    Thanks Again,
    Matt

  • OBIEE Error 'Root XML Node nqw not found in island!'

    Hello,
    After I altered my Hyperion Essbase structure, my OBIEE Reports don't open.
    I increase one generation in my accounts hierachy, and now when I try open my OBIEE reports, I get the follow error:
    "Root XML Node nqw not found in island"
    Any help?
    Thanks,

    Hi Naresh,
    I hope you have resolved the issue by this time.
    In my case, it was related to an invalid filter on the report.
    I have removed the filter by updating the report .xml file from Catalog Manager.
    Hope this helps other with similar issue.
    Thanks,
    Ravi

  • Unknown tag name: [session] in XML node: [toplink-configuration].

    I get this exception at runtime, running TOPLink as persistence manager for my BMP WL7 beans. My sessions.xml validates according to the sessions_4_5.dtd file supplied with TOPLink, but yet I get this excpetion. Below is my complete sessions.xml, as well as teh header of the exception stack
    Sessions.xml
    <?xml version="1.0" encoding="US-ASCII"?>
    <!DOCTYPE toplink-configuration PUBLIC "-//Oracle Corp.//DTD TopLink for JAVA 4.5//EN" "sessions_4_5.dtd">
    <toplink-configuration>
         <session>
              <name>entitySession</name>
              <project-class>za.co.discovery.legalentity.persistence.TOPLinkProject</project-class>
              <session-type>
                   <server-session/>
              </session-type>
              <login>
                   <uses-external-connection-pool>true</uses-external-connection-pool>
                   <uses-external-transaction-controller>true</uses-external-transaction-controller>
              </login>
              <external-transaction-controller-class>oracle.toplink.jts.wls.WebLogicJTSExternalTransactionController</external-transaction-controller-class>
              <enable-logging>true</enable-logging>
              <logging-options>
                   <log-debug>false</log-debug>
                   <log-exceptions>true</log-exceptions>
                   <log-exception-stacktrace>true</log-exception-stacktrace>
                   <print-thread>false</print-thread>
                   <print-session>true</print-session>
                   <print-connection>true</print-connection>
                   <print-date>false</print-date>
              </logging-options>
         </session>
    </toplink-configuration>
    and the stack trace:
    1) testAll(za.co.discovery.legalentity.ejb.test.ClassVersionTest)java.rmi.RemoteException: Exception in ejbFindByPrimaryKey; nested exception is:
         EXCEPTION [TOPLINK-7094] (TopLink - 9.0.3 (Build 423)): oracle.toplink.exceptions.ValidationException
    EXCEPTION DESCRIPTION: LOCAL EXCEPTION STACK:
    EXCEPTION DESCRIPTION: Several [2] SessionLoaderExceptions were thrown:
    EXCEPTION [TOPLINK-9002] (TopLink - 9.0.3 (Build 423)): oracle.toplink.exceptions.SessionLoaderException
    EXCEPTION DESCRIPTION: Unable to load Project class [za.co.discovery.legalentity.persistence.TOPLinkProject].
    INTERNAL EXCEPTION: java.lang.ExceptionInInitializerError
    EXCEPTION [TOPLINK-9001] (TopLink - 9.0.3 (Build 423)): oracle.toplink.exceptions.SessionLoaderException
    EXCEPTION DESCRIPTION: Unknown tag name: [session] in XML node: [toplink-configuration].
    INTERNAL EXCEPTION: java.lang.reflect.InvocationTargetException
    TARGET INVOCATION EXCEPTION: java.lang.NullPointerException
         at oracle.toplink.exceptions.SessionLoaderException.finalException(Unknown Source)
         at oracle.toplink.tools.sessionconfiguration.XMLLoader.load(Unknown Source)
         at oracle.toplink.tools.sessionmanagement.SessionManager.getSession(Unknown Source)
         at oracle.toplink.tools.sessionmanagement.SessionManager.getSession(Unknown Source)
         at oracle.toplink.ejb.EJBDataStore.getSession(Unknown Source)
         at oracle.toplink.ejb.EJBDataStore.getDescriptor(Unknown Source)
         at oracle.toplink.ejb.EJBDataStore.getWrapperPolicy(Unknown Source)
         at oracle.toplink.ejb.EJBDataStore.findByPrimaryKey(Unknown Source)
         at oracle.toplink.ejb.bmp.BMPEntityBase.findByPrimaryKey(Unknown Source)
         at za.co.discovery.legalentity.ejb.LegalEntityEJB.ejbFindByPrimaryKey(LegalEntityEJB.java:67)
    all help appreciated!
    thanks
    Alwyn ([email protected])

    Hi Alwyn
    I've seen this exact problem before when the sessions.xml file has been parsed by a different version of xerces from the one provided in TopLink. Is this a possibility?
    JIM

Maybe you are looking for

  • Will any wireless keyboard and mouse work with the Macbook Air?

    I just need to know if my existing keyboard/mouse will work or if I need to purchase new.

  • Embedded QuickTime movie malfuncioning

    I'm using Keynote '08 (vers 4.04) under Tiger. One of the slides in my Keynote presentation is a short QuickTime clip with audio. Everything works perfectly when I play the Keynote presentation. However, after adding a narration to the presentation a

  • Urgent_LSMW_Using IDoc method.

    Hi all,      How can I upload data using idoc in lsmw.(vendor data).Please explain me step by step. Regards Vijaya

  • Outlook 2011 on macbook pro

    After months of working fine, my outgoing mail is not working on my macbook.  I use outlook 2011 and have it configured using an me account.  I can't get the "me" to give me a green status.  I have changed the password to the strongest, outgoing is 5

  • How do I keep my video from stuttering?

    Hello...I have some short QT video clips that I placed on my iWeb project, but they stutter pretty badly during playback. I used a preset in Compressor (1000 kbps, 640x480, Best Quality). Clips are between 2-6 MB. When I play them in the QT player th